@@ -11,8 +11,9 @@ time, in any supported format, and output it as needed in any other format,
11
11
even if the data format changes on either side halfway through.
12
12
13
13
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.
16
17
17
18
Audio streams can also use an app-provided callback to supply data
18
19
on-demand, which maps pretty closely to the SDL2 audio model.
@@ -46,18 +47,20 @@ want to.
46
47
47
48
## Simplified audio
48
49
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_ .
61
64
62
65
## Channel layouts
63
66
0 commit comments