Skip to content

Commit f95d858

Browse files
committed
Sync SDL3 header -> wiki
1 parent 0779608 commit f95d858

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

SDL3/CategoryAudio.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ time, in any supported format, and output it as needed in any other format,
1111
even if the data format changes on either side halfway through.
1212

1313
An app opens an audio device and binds any number of audio streams to it,
14-
feeding more data to the streams as available. When the device needs more data, it
15-
will pull it from all bound streams and mix them together for playback.
14+
feeding more data to the streams as available. When the device needs more
15+
data, it will pull it from all bound streams and mix them together for
16+
playback.
1617

1718
Audio streams can also use an app-provided callback to supply data
1819
on-demand, which maps pretty closely to the SDL2 audio model.
@@ -46,18 +47,20 @@ want to.
4647

4748
## Simplified audio
4849

49-
As a simplified model for when a single source of audio is all that's needed, an
50-
app can use [SDL_OpenAudioDeviceStream](SDL_OpenAudioDeviceStream), which is a
51-
single function to open an audio device, create an audio stream, bind that stream
52-
to the newly-opened device, and (optionally) provide a callback for obtaining
53-
audio data. When using this function, the primary interface is the
54-
[SDL_AudioStream](SDL_AudioStream) and the device handle is mostly hidden away;
55-
destroying a stream created through this function will also close the device,
56-
stream bindings cannot be changed, etc. One other quirk of this is that the
57-
device is started in a _paused_ state and must be explicitly resumed; this is
58-
partially to offer a clean migration for SDL2 apps and partially because the app
59-
might have to do more setup before playback begins; in the non-simplified form,
60-
nothing will play until a stream is bound to a device, so they start _unpaused_.
50+
As a simplified model for when a single source of audio is all that's
51+
needed, an app can use
52+
[SDL_OpenAudioDeviceStream](SDL_OpenAudioDeviceStream), which is a single
53+
function to open an audio device, create an audio stream, bind that stream
54+
to the newly-opened device, and (optionally) provide a callback for
55+
obtaining audio data. When using this function, the primary interface is
56+
the [SDL_AudioStream](SDL_AudioStream) and the device handle is mostly
57+
hidden away; destroying a stream created through this function will also
58+
close the device, stream bindings cannot be changed, etc. One other quirk
59+
of this is that the device is started in a _paused_ state and must be
60+
explicitly resumed; this is partially to offer a clean migration for SDL2
61+
apps and partially because the app might have to do more setup before
62+
playback begins; in the non-simplified form, nothing will play until a
63+
stream is bound to a device, so they start _unpaused_.
6164

6265
## Channel layouts
6366

0 commit comments

Comments
 (0)