home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3dm / audiofile / afSetVirtualSampleFormat.z / afSetVirtualSampleFormat
Encoding:
Text File  |  2002-10-03  |  12.7 KB  |  199 lines

  1.  
  2.  
  3.  
  4. aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))                    aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      afSetVirtualSampleFormat, afSetVirtualByteOrder, afSetVirtualChannels,
  10.      afSetVirtualRate, afSetVirtualPCMMapping - set the virtual data format
  11.      for a specified audio track
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////aaaauuuuddddiiiiooooffffiiiilllleeee....hhhh>>>>
  15.  
  16.      iiiinnnntttt aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk,,,,
  17.                                    iiiinnnntttt ssssaaaammmmppppffffmmmmtttt,,,, iiiinnnntttt ssssaaaammmmppppwwwwiiiiddddtttthhhh))))
  18.  
  19.      iiiinnnntttt aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllBBBByyyytttteeeeOOOOrrrrddddeeeerrrr((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk,,,, iiiinnnntttt bbbbyyyytttteeeeoooorrrrddddeeeerrrr))))
  20.  
  21.      iiiinnnntttt aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllCCCChhhhaaaannnnnnnneeeellllssss((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk,,,, iiiinnnntttt cccchhhhaaaannnnnnnneeeellllssss))))
  22.  
  23.      iiiinnnntttt aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllRRRRaaaatttteeee((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk,,,, ddddoooouuuubbbblllleeee rrrraaaatttteeee))))
  24.  
  25.      iiiinnnntttt aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllPPPPCCCCMMMMMMMMaaaappppppppiiiinnnngggg((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee,,,, iiiinnnntttt ttttrrrraaaacccckkkk,,,,
  26.                                  ddddoooouuuubbbblllleeee ssssllllooooppppeeee,,,, ddddoooouuuubbbblllleeee iiiinnnntttteeeerrrrcccceeeepppptttt,,,,
  27.                                  ddddoooouuuubbbblllleeee mmmmiiiinnnncccclllliiiipppp,,,, ddddoooouuuubbbblllleeee mmmmaaaaxxxxcccclllliiiipppp))))
  28.  
  29.  
  30. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
  31.      Parameters for the virtual routines are identical to those for the
  32.      equivalent afInit routines, except the first argument is an AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee
  33.      structure rather than an AAAAFFFFffffiiiilllleeeesssseeeettttuuuupppp.
  34.  
  35.      _f_i_l_e        is an AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee structure, previously created by a call to
  36.                  aaaaffffOOOOppppeeeennnnFFFFiiiilllleeee(3dm) or its equivalent.
  37.  
  38.      _t_r_a_c_k       is an integer which identifies an audio track in _h_a_n_d_l_e.
  39.  
  40.                  Since all currently supported file formats contain only one
  41.                  audio track, the value AAAAFFFF____DDDDEEEEFFFFAAAAUUUULLLLTTTT____TTTTRRRRAAAACCCCKKKK should always be used
  42.                  here.
  43.  
  44.      _s_a_m_p_f_m_t     an integer constant which denotes a virtual sample format.
  45.  
  46.      _s_a_m_p_w_i_d_t_h   a positive integer value which specifies the number of bits
  47.                  in a virtual sample data point.
  48.  
  49.      _c_h_a_n_n_e_l_s    is a positive integer value which indicates the number of
  50.                  interleaved audio channels in the audio track.
  51.  
  52.      _b_y_t_e_o_r_d_e_r   is a positive integer token which indicates the byte order of
  53.                  the samples in the audio track.
  54.  
  55.      _r_a_t_e        is a double precision floating point value indicating the
  56.                  sampling rate for the virtual audio data.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))                    aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))
  71.  
  72.  
  73.  
  74.      _s_l_o_p_e       is a double precision floating point value
  75.  
  76.      _i_n_t_e_r_c_e_p_t   is a double precision floating point value indicating the
  77.                  audio data sample zero-crossing value for the given sample
  78.                  format and width
  79.  
  80.      _m_i_n_c_l_i_p     is a double precision floating point value indicating the
  81.                  minimum or most negative audio data sample value to be
  82.                  returned.  Any value less than this will be set to _m_i_n_c_l_i_p
  83.  
  84.      _m_a_x_c_l_i_p     is a double precision floating point value indicating the
  85.                  maximum or most positive audio data sample value to be
  86.                  returned.  Any value greater than this will be set to _m_a_x_c_l_i_p
  87.  
  88. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  89.      When a audio data is read from a file into the application's data buffer
  90.      using aaaaffffRRRReeeeaaaaddddFFFFrrrraaaammmmeeeessss(3dm), the format of the data loaded into the buffer
  91.      can vary independently of the actual file data format.  This independent
  92.      format is call the _v_i_r_t_u_a_l _f_o_r_m_a_t of the data.  Once some aspect of the
  93.      virtual data format is set via one of the above-described routines, the
  94.      conversion of the _f_i_l_e _f_o_r_m_a_t into the _v_i_r_t_u_a_l _f_o_r_m_a_t happens
  95.      automatically and transparently.  This allows an application to choose to
  96.      ignore the data format in the file entirely, and specify only the format
  97.      in which it wants the data to appear in the aaaaffffRRRReeeeaaaaddddFFFFrrrraaaammmmeeeessss(3dm) buffer.
  98.      See aaaaffffIIIInnnnttttrrrroooo(3dm) for more information about the virtual format.
  99.  
  100.      aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt(((()))) sets the virtual sample format and width
  101.      parameters for the audio data buffer.
  102.  
  103.      The following values may be used for _s_a_m_p_f_m_t
  104.  
  105.      AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____TTTTWWWWOOOOSSSSCCCCOOOOMMMMPPPP   Two's complement samples.
  106.  
  107.      AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____UUUUNNNNSSSSIIIIGGGGNNNNEEEEDDDD   Unsigned samples.
  108.  
  109.      AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____FFFFLLLLOOOOAAAATTTT      32-bit floating point samples.
  110.  
  111.      AAAAFFFF____SSSSAAAAMMMMPPPPFFFFMMMMTTTT____DDDDOOOOUUUUBBBBLLLLEEEE     64-bit double-precision floating point samples.
  112.  
  113.      aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllBBBByyyytttteeeeOOOOrrrrddddeeeerrrr(((()))) sets the virtual byte order (big- or little-
  114.      endian) of the samples in the audio buffer.
  115.  
  116.      The following values may be used for _b_y_t_e_o_r_d_e_r
  117.  
  118.      AAAAFFFF____BBBBYYYYTTTTEEEEOOOORRRRDDDDEEEERRRR____BBBBIIIIGGGGEEEENNNNDDDDIIIIAAAANNNN      Big-endian byte order samples.  This is the
  119.                                  default value.
  120.  
  121.      AAAAFFFF____BBBBYYYYTTTTEEEEOOOORRRRDDDDEEEERRRR____LLLLIIIITTTTTTTTLLLLEEEEEEEENNNNDDDDIIIIAAAANNNN   Little-endian byte order samples.
  122.  
  123.      aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllCCCChhhhaaaannnnnnnneeeellllssss(((()))) sets the number of virtual interleaved channels in
  124.      the audio buffer.  If the virtual channel count does not equal the track
  125.      channel count, channel conversion is performed via a channel mix matrix.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))                    aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt((((3333ddddmmmm))))
  137.  
  138.  
  139.  
  140.      If this matrix is not specified, a default matrix will be used.  This
  141.      default matrix follows the same channel conversion rules as the Audio
  142.      Library (libaudio).  See aaaaffffSSSSeeeettttCCCChhhhaaaannnnnnnneeeellllMMMMaaaattttrrrriiiixxxx(3dm) for details.
  143.  
  144.      aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllRRRRaaaatttteeee(((()))) sets the virtual sampling rate for the audio buffer.
  145.      If the track sampling rate is different, the data will be rate-converted
  146.      using one of several conversion algorithms.  See
  147.      aaaaffffSSSSeeeettttCCCCoooonnnnvvvveeeerrrrssssiiiioooonnnnPPPPaaaarrrraaaammmmssss(3dm) for more information.
  148.  
  149.      aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllPPPPCCCCMMMMMMMMaaaappppppppiiiinnnngggg(((()))) sets the virtual PCM mapping values for the
  150.      audio buffer.  The range, zero-crossing, and clipping values for the data
  151.      placed in the audio buffer will be determined via a transformation
  152.      calculated from the relationship between the file's PCM mapping and the
  153.      requested mapping.  In general, all two's complement and floating point
  154.      sample formats are expected to be symmetrical about zero, i.e., the
  155.      iiiinnnntttteeeerrrrcccceeeepppptttt will be 0.0 and _m_i_n_c_l_i_p and _m_a_x_c_l_i_p will be negative and
  156.      positive N, where N is some non-zero positive value.  If this routine is
  157.      used, it must be called _a_f_t_e_r any calls to aaaaffffSSSSeeeettttVVVViiiirrrrttttuuuuaaaallllSSSSaaaammmmpppplllleeeeFFFFoooorrrrmmmmaaaatttt(((()))).
  158.      Resetting the virtual sample format automatically resets the PCM mapping
  159.      to the default values for the requested format.
  160.  
  161. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  162.      afOpenFile(3dm), afReadFrames(3dm), afWriteFrames(3dm),
  163.      afGetVirtualSampleFormat(3dm), afGetVirtualChannels(3dm),
  164.      afSetChannelMatrix(3dm), afGetVirtualByteOrder(3dm),
  165.      afGetVirtualPCMMapping(3dm), afGetVirtualRate(3dm)
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.