Skip to content

Commit

Permalink
SDL3/Tutorials/AudioStream: Updated example code for latest SDL3 API.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus authored and SDLWikiBot committed May 8, 2024
1 parent 77b2ace commit 3f1bb54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SDL3/Tutorials/AudioStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ Using SDL_AudioStream is pretty simple. First, you create one. Let's say you wan

```c
// You put data at Sint16/mono/22050Hz, you get back data at Float32/stereo/48000Hz.
SDL_AudioStream *stream = SDL_CreateAudioStream(AUDIO_S16, 1, 22050, AUDIO_F32, 2, 48000);
const SDL_AudioSpec srcspec = { SDL_AUDIO_S16, 1, 22050 };
const SDL_AudioSpec dstspec = { SDL_AUDIO_F32, 2, 48000 };
SDL_AudioStream *stream = SDL_CreateAudioStream(&srcspec, &dstspec);
if (stream == NULL) {
printf("Uhoh, stream failed to create: %s\n", SDL_GetError());
} else {
Expand Down

0 comments on commit 3f1bb54

Please sign in to comment.