|
Size: 1140
Comment: Removed spaces in example and deactivated camel case.
|
Size: 1140
Comment: Fixed typos.
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 5: | Line 5: |
| Use this function to return the number of built in audio drivers. | Use this function to return the number of built-in audio drivers. |
| Line 15: | Line 15: |
| Returns the number of built in audio drivers. | Returns the number of built-in audio drivers. |
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 esound support, but if there's no esound server available, SDL's esound driver would fail if used.
By default, SDL tries all drivers, in its preferred order, until one is found to be usable.
