Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
SDL_ConvertAudio(3)
Edit
PageHistory
Diff
Info
LikePages
SDL_!ConvertAudio !!!SDL_!ConvertAudio NAME SYNOPSIS DESCRIPTION EXAMPLES SEE ALSO ---- !!NAME SDL_!ConvertAudio- Convert audio data to a desired audio format. !!SYNOPSIS __#include __ __int SDL_!ConvertAudio__(__SDL_AudioCVT *cvt__); !!DESCRIPTION __SDL_!ConvertAudio__ takes one parameter, __cvt__, which was previously initilized. Initilizing a __SDL_AudioCVT__ is a two step process. First of all, the structure must be passed to __SDL_BuildAudioCVT__ along with source and destination format parameters. Secondly, the __cvt__-__buf__ and __cvt__-__len__ fields must be setup. __cvt__-__buf__ should point to the audio data and __cvt__-__len__ should be set to the length of the audio data in bytes. Remember, the length of the buffer pointed to by __buf__ show be __len__*__len_mult__ bytes in length. Once the __SDL_AudioCVT__structure is initilized then we can pass it to __SDL_!ConvertAudio__, which will convert the audio data pointer to by __cvt__-__buf__. If __SDL_!ConvertAudio__ returned __0__ then the conversion was completed successfully, otherwise __-1__ is returned. 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__. !!EXAMPLES /* Converting some WAV data to hardware format */ void my_audio_callback(void *userdata, Uint8 *stream, int len); SDL_!AudioSpec *desired, *obtained; SDL_!AudioSpec wav_spec; SDL_AudioCVT wav_cvt; Uint32 wav_len; Uint8 *wav_buf; int ret; /* Allocated audio specs */ desired=(SDL_!AudioSpec *)malloc(sizeof(SDL_!AudioSpec)); obtained=(SDL_!AudioSpec *)malloc(sizeof(SDL_!AudioSpec)); /* Set desired format */ desired- !!SEE ALSO __SDL_BuildAudioCVT__, __SDL_AudioCVT__ ----
One page links to
SDL_ConvertAudio(3)
:
SDLManPages
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.