Wiki Page Content

Differences between revisions 8 and 9
Revision 8 as of 2013-07-14 06:44:09
Size: 701
Editor: RainerDeyke
Comment: Fixed syntax error in code example.
Revision 9 as of 2013-08-08 05:29:04
Size: 1156
Editor: RyanGordon
Comment: rewritten
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
Returns the number of built in audio drivers.  <<Color2(green,Does this have an error state?)>> Returns the number of built in audio drivers.
Line 20: Line 20:
Line 27: Line 26:
''You can add useful comments here'' This function returns a hardcoded number. This never returns a negative value; if there are no drivers compiled into this build of SDL, this function returns zero. The presence of a driver in this list does not mean it will function, it just means SDL is capable of interacting with that interface. For example, a build of SDL might have PulseAudio support, but if there's no PulseAudio server available, SDL's PulseAudio driver would fail if used.

By default, SDL tries all drivers, in its preferred order, until one is found to be usable.

SDL_GetNumAudioDrivers

Use this function to return the number of built in audio drivers.

Syntax

int SDL_GetNumAudioDrivers(void)

Return Value

Returns the number of built in audio drivers.

Code Examples

int i;
for ( i = 0; i < SDL_GetNumAudioDrivers(); ++i ) {
    printf("Audio driver %d: %s\n", i, SDL_GetAudioDriver(i));
}

Remarks

This function returns a hardcoded number. This never returns a negative value; if there are no drivers compiled into this build of SDL, this function returns zero. The presence of a driver in this list does not mean it will function, it just means SDL is capable of interacting with that interface. For example, a build of SDL might have PulseAudio support, but if there's no PulseAudio server available, SDL's PulseAudio driver would fail if used.

By default, SDL tries all drivers, in its preferred order, until one is found to be usable.


CategoryAPI, CategoryAudio

None: SDL_GetNumAudioDrivers (last edited 2016-05-14 22:18:35 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit