Wiki Page Content

Revision 1 as of 2009-11-12 21:03:33

Clear message

SDL_ConvertAudio

Use this function to convert audio data to a desired audio format.

Syntax

int SDL_ConvertAudio (SDL_AudioCVT * cvt)

Function Parameters

Return Value

Returns 0 if the conversion was completed successfully, otherwise -1 is returned.

Code Examples

You can add your code example here

Remarks

Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of audio data in the source format, this function will convert it in-place to the desired format.

The data conversion may expand the size of the audio data, so the buffer \c cvt->buf should be allocated after the \c cvt structure is initialized by SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.

If the conversion completed successfully then the converted audio data can be read from cvt->buf. The amount of valid, converted, audio data in the buffer is equal to cvt->len*cvt->len_ratio.

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit