mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-22 19:18:30 +00:00
Merge the SDL3 audio subsystem redesign!
This rips up the entire SDL audio subsystem! While we still feed the audio device from a separate thread, the audio callback into the app is now gone a totally optional alternative. Now the app will bind an SDL_AudioStream to a given device and feed data to it. As many streams as one likes can be bound to a device; SDL will mix them all into a single buffer and feed the device from there. So not only does this function as a basic mixer, it also means that multiple device opens are handled seamlessly (so if you want to open the device for your game, but you also link to a library that provides VoIP and it wants to open the device separately, you don't have to worry about stepping on each other, or that the OS will fail to allow multiple opens of the same device, etc). Merged from pull request #7704. Fixes #7379. Reference Issue #6889. Reference Issue #6632.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -493,7 +493,7 @@ typedef struct SDL_AudioDeviceEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_AUDIO_DEVICE_ADDED, or ::SDL_EVENT_AUDIO_DEVICE_REMOVED */
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_AudioDeviceID which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
|
||||
SDL_AudioDeviceID which; /**< SDL_AudioDeviceID for the device being added or removed */
|
||||
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
|
@@ -97,7 +97,9 @@ typedef struct
|
||||
|
||||
/* Audio info */
|
||||
const char *audiodriver;
|
||||
SDL_AudioSpec audiospec;
|
||||
SDL_AudioFormat audio_format;
|
||||
int audio_channels;
|
||||
int audio_freq;
|
||||
SDL_AudioDeviceID audio_id;
|
||||
|
||||
/* GL settings */
|
||||
|
Reference in New Issue
Block a user