SDL_BuildAudioCVT(3)

πŸ’– SDL_BuildAudioCVT πŸ’–

okay so bestie, welcome to the SDL API Reference, this one's from the SDL manual and it's genuinely so useful β€” let's get into it πŸŽ€

✨ NAME ✨

SDL_BuildAudioCVT β€” it initializes an SDL_AudioCVT structure so it's ready to do conversion πŸ¦‹

🌸 SYNOPSIS 🌸

#include "SDL.h"

int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, Uint16 src_format, Uint8
src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int
dst_rate);

πŸ’… DESCRIPTION πŸ’…

so like, an SDL_AudioCVT structure literally cannot do its little audio-conversion job until you've initialized it with the source and destination info. that's the whole vibe. no init, no convert, periodt ✨

  • src_format and dst_format β€” these are the source and destination format of the conversion. (if you wanna know about audio formats, go peek at SDL_AudioSpec πŸ’œ)
  • src_channels and dst_channels β€” the number of channels in the source format and the destination format respectively 🎧
  • src_rate and dst_rate β€” the frequency, aka samples-per-second, of the source and destination formats. and yeah, once again, see SDL_AudioSpec for the tea 🌈

🫢 RETURN VALUES 🫢

  • returns -1 if the filter could not be built 😭
  • returns 1 if it could πŸ‘‘

🌟 EXAMPLES 🌟

see SDL_ConvertAudio for the example, bestie β€” that's where the goods are ✨

πŸ‘€ SEE ALSO πŸ‘€

  • SDL_ConvertAudio
  • SDL_AudioCVT

and that's the whole thing, no cap πŸ’– this page is from the SDL manual, dated Tue 11 Sep 2001, 22:58 β€” iconic vintage energy fr fr, mwah πŸŽ€πŸ’…πŸ¦‹

πŸ“¦ where this page comes from