|
Size: 1241
Comment:
|
Size: 594
Comment: edited wrong page
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 4: | Line 4: |
| = SDL_GetNumAudioDevices = Use this function to return the number of built in audio devices. |
= SDL_GetNumAudioDrivers = Use this function to return the number of built in audio drivers. |
| Line 11: | Line 11: |
| int SDL_GetNumAudioDevices (int iscapture) | int SDL_GetNumAudioDrivers(void) |
| Line 13: | Line 13: |
== Function Parameters == ||'''iscapture'''||non-0 to specify a device that has recording capability|| |
|
| Line 22: | Line 19: |
| int i, count = SDL_GetNumAudioDevices(0); | int i; |
| Line 24: | Line 21: |
| for ( i = 0; i < count; ++i ) { printf("Audio device %d: %s\n", i, SDL_GetAudioDeviceName(i, 0); |
for ( i = 0; i < SDL_GetNumAudioDrivers(); ++i ) { printf("Audio driver %d: %s\n", i, SDL_GetAudioDriver(i); |
| Line 30: | Line 27: |
| This function is only valid after successfully initializing the audio subsystem. Returns -1 if an explicit list of devices can't be determined; this is not an error. For example, if SDL is set up to talk to a remote audio server, it can't list every one available on the Internet, but it will still allow a specific host to be specified to [[SDL_OpenAudioDevice]](). In many common cases, when this function returns a value <= 0, it can still successfully open the default device (NULL for first argument of [[SDL_OpenAudioDevice]]()). |
You can add useful comments here |
SDL_GetNumAudioDrivers
Use this function to return the number of built in audio drivers.
Syntax
int SDL_GetNumAudioDrivers(void)
Return Value
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
You can add useful comments here
