include/SDL_audio.h
changeset 11639 b72de18f13ce
parent 11636 ec1c9bded2d0
child 11640 dc5774b11998
equal deleted inserted replaced
11638:2393519f642e 11639:b72de18f13ce
   500  *  \return 0 on success, or -1 on error.
   500  *  \return 0 on success, or -1 on error.
   501  *
   501  *
   502  *  \sa SDL_AudioStreamPut
   502  *  \sa SDL_AudioStreamPut
   503  *  \sa SDL_AudioStreamGet
   503  *  \sa SDL_AudioStreamGet
   504  *  \sa SDL_AudioStreamAvailable
   504  *  \sa SDL_AudioStreamAvailable
       
   505  *  \sa SDL_AudioStreamFlush
   505  *  \sa SDL_AudioStreamClear
   506  *  \sa SDL_AudioStreamClear
   506  *  \sa SDL_FreeAudioStream
   507  *  \sa SDL_FreeAudioStream
   507  */
   508  */
   508 extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format,
   509 extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format,
   509                                            const Uint8 src_channels,
   510                                            const Uint8 src_channels,
   521  *  \return 0 on success, or -1 on error.
   522  *  \return 0 on success, or -1 on error.
   522  *
   523  *
   523  *  \sa SDL_NewAudioStream
   524  *  \sa SDL_NewAudioStream
   524  *  \sa SDL_AudioStreamGet
   525  *  \sa SDL_AudioStreamGet
   525  *  \sa SDL_AudioStreamAvailable
   526  *  \sa SDL_AudioStreamAvailable
       
   527  *  \sa SDL_AudioStreamFlush
   526  *  \sa SDL_AudioStreamClear
   528  *  \sa SDL_AudioStreamClear
   527  *  \sa SDL_FreeAudioStream
   529  *  \sa SDL_FreeAudioStream
   528  */
   530  */
   529 extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len);
   531 extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len);
   530 
   532 
   537  *  \return The number of bytes read from the stream, or -1 on error
   539  *  \return The number of bytes read from the stream, or -1 on error
   538  *
   540  *
   539  *  \sa SDL_NewAudioStream
   541  *  \sa SDL_NewAudioStream
   540  *  \sa SDL_AudioStreamPut
   542  *  \sa SDL_AudioStreamPut
   541  *  \sa SDL_AudioStreamAvailable
   543  *  \sa SDL_AudioStreamAvailable
       
   544  *  \sa SDL_AudioStreamFlush
   542  *  \sa SDL_AudioStreamClear
   545  *  \sa SDL_AudioStreamClear
   543  *  \sa SDL_FreeAudioStream
   546  *  \sa SDL_FreeAudioStream
   544  */
   547  */
   545 extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len);
   548 extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len);
   546 
   549 
   551  *  be zero. Add more data or flush the stream if you need the data now.
   554  *  be zero. Add more data or flush the stream if you need the data now.
   552  *
   555  *
   553  *  \sa SDL_NewAudioStream
   556  *  \sa SDL_NewAudioStream
   554  *  \sa SDL_AudioStreamPut
   557  *  \sa SDL_AudioStreamPut
   555  *  \sa SDL_AudioStreamGet
   558  *  \sa SDL_AudioStreamGet
       
   559  *  \sa SDL_AudioStreamFlush
   556  *  \sa SDL_AudioStreamClear
   560  *  \sa SDL_AudioStreamClear
   557  *  \sa SDL_AudioStreamFlush
       
   558  *  \sa SDL_FreeAudioStream
   561  *  \sa SDL_FreeAudioStream
   559  */
   562  */
   560 extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream);
   563 extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream);
   561 
   564 
   562 /**
   565 /**
   564  *  should be converted/resampled and made available immediately.
   567  *  should be converted/resampled and made available immediately.
   565  *
   568  *
   566  * It is legal to add more data to a stream after flushing, but there will
   569  * It is legal to add more data to a stream after flushing, but there will
   567  *  be audio gaps in the output. Generally this is intended to signal the
   570  *  be audio gaps in the output. Generally this is intended to signal the
   568  *  end of input, so the complete output becomes available.
   571  *  end of input, so the complete output becomes available.
   569  *
       
   570  *  \sa SDL_NewAudioStream
       
   571  *  \sa SDL_AudioStreamPut
       
   572  *  \sa SDL_AudioStreamGet
       
   573  *  \sa SDL_AudioStreamClear
       
   574  *  \sa SDL_FreeAudioStream
       
   575  */
       
   576 extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream);
       
   577 
       
   578 /**
       
   579  *  Clear any pending data in the stream without converting it
       
   580  *
   572  *
   581  *  \sa SDL_NewAudioStream
   573  *  \sa SDL_NewAudioStream
   582  *  \sa SDL_AudioStreamPut
   574  *  \sa SDL_AudioStreamPut
   583  *  \sa SDL_AudioStreamGet
   575  *  \sa SDL_AudioStreamGet
   584  *  \sa SDL_AudioStreamAvailable
   576  *  \sa SDL_AudioStreamAvailable
       
   577  *  \sa SDL_AudioStreamClear
   585  *  \sa SDL_FreeAudioStream
   578  *  \sa SDL_FreeAudioStream
   586  */
   579  */
   587 extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
   580 extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream);
   588 
   581 
   589 /**
   582 /**
   590  * Free an audio stream
   583  *  Clear any pending data in the stream without converting it
   591  *
   584  *
   592  *  \sa SDL_NewAudioStream
   585  *  \sa SDL_NewAudioStream
   593  *  \sa SDL_AudioStreamPut
   586  *  \sa SDL_AudioStreamPut
   594  *  \sa SDL_AudioStreamGet
   587  *  \sa SDL_AudioStreamGet
   595  *  \sa SDL_AudioStreamAvailable
   588  *  \sa SDL_AudioStreamAvailable
       
   589  *  \sa SDL_AudioStreamFlush
       
   590  *  \sa SDL_FreeAudioStream
       
   591  */
       
   592 extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
       
   593 
       
   594 /**
       
   595  * Free an audio stream
       
   596  *
       
   597  *  \sa SDL_NewAudioStream
       
   598  *  \sa SDL_AudioStreamPut
       
   599  *  \sa SDL_AudioStreamGet
       
   600  *  \sa SDL_AudioStreamAvailable
       
   601  *  \sa SDL_AudioStreamFlush
   596  *  \sa SDL_AudioStreamClear
   602  *  \sa SDL_AudioStreamClear
   597  */
   603  */
   598 extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
   604 extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
   599 
   605 
   600 #define SDL_MIX_MAXVOLUME 128
   606 #define SDL_MIX_MAXVOLUME 128