Wiki Page Content

Differences between revisions 2 and 3
Revision 2 as of 2009-11-19 07:02:12
Size: 1775
Editor: SheenaSmith
Comment: content added
Revision 3 as of 2009-11-19 07:03:40
Size: 1803
Editor: SheenaSmith
Comment: content added
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
 .[[SDL_CloseAudioDevice]]

SDL_OpenAudioDevice

Use this function to open a specific audio device.

Syntax

SDL_AudioDeviceID SDL_OpenAudioDevice(const char*          device,
                                      int                  iscapture,
                                      const SDL_AudioSpec* desired,
                                      SDL_AudioSpec*       obtained,
                                      int                  allowed_changes)

Function Parameters

device

a UTF-8 string reported by SDL_GetAudioDeviceName(); see Remarks

iscapture

non-0 to specify a device that has recording capability

desired

the desired audio parameters; see SDL_OpenAudio() for more information

obtained

a pointer to an SDL_AudioSpec structure to be filled in; see SDL_OpenAudio() for more information

allowed_changes

Return Value

Returns a valid device ID that is >= 2 on success or 0 on failure; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

Passing in a device name of NULL requests the most reasonable default (and is equivalent to calling SDL_OpenAudio()). The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but some drivers allow arbitrary and driver-specific strings, such as a hostname/IP address for a remote audio server, or a filename in the diskaudio driver.

SDL_OpenAudio(), unlike this function, always acts on device ID 1.

None: SDL_OpenAudioDevice (last edited 2017-03-30 12:26:07 by ChrisBush)

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