I’m quite new to audios, could anyone please tell me what’s the format
of `AUDIO_S16SYS’? Are they ADPCM samples? I’ve seem some audio
decoder(such as ffmpeg) send the decoded stream and then use SDL to
display sound:
They are raw samples (“PCM”), signed 16 bit integers per channel (so 32
bits per sample frame if you’re in stereo mode, etc), and in the byte
order of the platform running the program.
SDL by itself doesn’t decode most higher-level formats (just
uncompressed .WAV, IMA-ADPCM and MS-ADPCM .WAV in SDL_LoadWAV)…if you
want to handle any serious formats, like MP3 or OGG, you have to look
elsewhere for something to build on top of SDL…SDL mostly just plays
noise, but supplying the noise is up to the application.
I’m quite new to audios, could anyone please tell me what’s the format
of `AUDIO_S16SYS’? Are they ADPCM samples? I’ve seem some audio
decoder(such as ffmpeg) send the decoded stream and then use SDL to
display sound:
They are raw samples (“PCM”), signed 16 bit integers per channel (so 32
bits per sample frame if you’re in stereo mode, etc), and in the byte
order of the platform running the program.
SDL by itself doesn’t decode most higher-level formats (just
uncompressed .WAV, IMA-ADPCM and MS-ADPCM .WAV in SDL_LoadWAV)…if you
want to handle any serious formats, like MP3 or OGG, you have to look
elsewhere for something to build on top of SDL…SDL mostly just plays
noise, but supplying the noise is up to the application.