@@ -172,7 +172,7 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
172
172
* 2: FL FR (stereo)
173
173
* 3: FL FR LFE (2.1 surround)
174
174
* 4: FL FR BL BR (quad)
175
- * 5: FL FR FC BL BR (quad + center )
175
+ * 5: FL FR LFE BL BR (4.1 surround )
176
176
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
177
177
* 7: FL FR FC LFE BC SL SR (6.1 surround)
178
178
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
@@ -487,6 +487,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
487
487
* \since This function is available since SDL 2.0.0.
488
488
*
489
489
* \sa SDL_GetNumAudioDevices
490
+ * \sa SDL_GetDefaultAudioInfo
490
491
*/
491
492
extern DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName (int index ,
492
493
int iscapture );
@@ -512,12 +513,48 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
512
513
* \since This function is available since SDL 2.0.16.
513
514
*
514
515
* \sa SDL_GetNumAudioDevices
516
+ * \sa SDL_GetDefaultAudioInfo
515
517
*/
516
518
extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec (int index ,
517
519
int iscapture ,
518
520
SDL_AudioSpec * spec );
519
521
520
522
523
+ /**
524
+ * Get the name and preferred format of the default audio device.
525
+ *
526
+ * Some (but not all!) platforms have an isolated mechanism to get information
527
+ * about the "default" device. This can actually be a completely different
528
+ * device that's not in the list you get from SDL_GetAudioDeviceSpec(). It can
529
+ * even be a network address! (This is discussed in SDL_OpenAudioDevice().)
530
+ *
531
+ * As a result, this call is not guaranteed to be performant, as it can query
532
+ * the sound server directly every time, unlike the other query functions. You
533
+ * should call this function sparingly!
534
+ *
535
+ * `spec` will be filled with the sample rate, sample format, and channel
536
+ * count, if a default device exists on the system. If `name` is provided,
537
+ * will be filled with either a dynamically-allocated UTF-8 string or NULL.
538
+ *
539
+ * \param name A pointer to be filled with the name of the default device (can
540
+ * be NULL). Please call SDL_free() when you are done with this
541
+ * pointer!
542
+ * \param spec The SDL_AudioSpec to be initialized by this function.
543
+ * \param iscapture non-zero to query the default recording device, zero to
544
+ * query the default output device.
545
+ * \returns 0 on success, nonzero on error
546
+ *
547
+ * \since This function is available since SDL 2.24.0.
548
+ *
549
+ * \sa SDL_GetAudioDeviceName
550
+ * \sa SDL_GetAudioDeviceSpec
551
+ * \sa SDL_OpenAudioDevice
552
+ */
553
+ extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo (char * * name ,
554
+ SDL_AudioSpec * spec ,
555
+ int iscapture );
556
+
557
+
521
558
/**
522
559
* Open a specific audio device.
523
560
*
@@ -584,6 +621,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
584
621
* - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE`
585
622
* - `SDL_AUDIO_ALLOW_FORMAT_CHANGE`
586
623
* - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE`
624
+ * - `SDL_AUDIO_ALLOW_SAMPLES_CHANGE`
587
625
* - `SDL_AUDIO_ALLOW_ANY_CHANGE`
588
626
*
589
627
* These flags specify how SDL should behave when a device cannot offer a
0 commit comments