include/SDL_audio.h
changeset 3554 cf815007e443
parent 3537 e897a4a9f578
child 3697 f7b03b6838cb
equal deleted inserted replaced
3553:a579694613fd 3554:cf815007e443
   151 /*@}*/
   151 /*@}*/
   152 
   152 
   153 /*@}*//*Audio flags*/
   153 /*@}*//*Audio flags*/
   154 
   154 
   155 /**
   155 /**
       
   156  *  This function is called when the audio device needs more data.
       
   157  *
       
   158  *  \param userdata An application-specific parameter saved in
       
   159  *                  the SDL_AudioSpec structure
       
   160  *  \param stream A pointer to the audio data buffer.
       
   161  *  \param len    The length of that buffer in bytes.
       
   162  *
       
   163  *  Once the callback returns, the buffer will no longer be valid.
       
   164  *  Stereo samples are stored in a LRLRLR ordering.
       
   165  */
       
   166 typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
       
   167                                             int len);
       
   168 
       
   169 /**
   156  *  The calculated values in this structure are calculated by SDL_OpenAudio().
   170  *  The calculated values in this structure are calculated by SDL_OpenAudio().
   157  */
   171  */
   158 typedef struct SDL_AudioSpec
   172 typedef struct SDL_AudioSpec
   159 {
   173 {
   160     int freq;                   /**< DSP frequency -- samples per second */
   174     int freq;                   /**< DSP frequency -- samples per second */
   162     Uint8 channels;             /**< Number of channels: 1 mono, 2 stereo */
   176     Uint8 channels;             /**< Number of channels: 1 mono, 2 stereo */
   163     Uint8 silence;              /**< Audio buffer silence value (calculated) */
   177     Uint8 silence;              /**< Audio buffer silence value (calculated) */
   164     Uint16 samples;             /**< Audio buffer size in samples (power of 2) */
   178     Uint16 samples;             /**< Audio buffer size in samples (power of 2) */
   165     Uint16 padding;             /**< Necessary for some compile environments */
   179     Uint16 padding;             /**< Necessary for some compile environments */
   166     Uint32 size;                /**< Audio buffer size in bytes (calculated) */
   180     Uint32 size;                /**< Audio buffer size in bytes (calculated) */
   167     /**
   181     SDL_AudioCallback callback;
   168      *  This function is called when the audio device needs more data.
       
   169      *
       
   170      *  \param stream A pointer to the audio data buffer.
       
   171      *  \param len    The length of that buffer in bytes.
       
   172      *
       
   173      *  Once the callback returns, the buffer will no longer be valid.
       
   174      *  Stereo samples are stored in a LRLRLR ordering.
       
   175      */
       
   176     void (SDLCALL * callback) (void *userdata, Uint8 * stream, int len);
       
   177     void *userdata;
   182     void *userdata;
   178 } SDL_AudioSpec;
   183 } SDL_AudioSpec;
   179 
   184 
   180 
   185 
   181 struct SDL_AudioCVT;
   186 struct SDL_AudioCVT;