comparison include/SDL_audio.h @ 3791:be33495e4d97 SDL-ryan-multiple-audio-device

Updated 1.3 audio documentation.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 03 Oct 2006 20:48:42 +0000
parents 8f8209f8da6d
children 866c310e2cb5
comparison
equal deleted inserted replaced
3790:8f8209f8da6d 3791:be33495e4d97
226 typedef Uint32 SDL_AudioDeviceID; 226 typedef Uint32 SDL_AudioDeviceID;
227 227
228 /* 228 /*
229 * Get the number of available devices exposed by the current driver. 229 * Get the number of available devices exposed by the current driver.
230 * Only valid after a successfully initializing the audio subsystem. 230 * Only valid after a successfully initializing the audio subsystem.
231 * Returns -1 if an explicit list of devices can't be determined; this is
232 * not an error. For example, if SDL is set up to talk to a remote audio
233 * server, it can't list every one available on the Internet, but it will
234 * still allow a specific host to be specified to SDL_OpenAudioDevice().
235 * In many common cases, when this function returns a value <= 0, it can still
236 * successfully open the default device (NULL for first argument of
237 * SDL_OpenAudioDevice()).
231 */ 238 */
232 extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); 239 extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
233 240
234 /* 241 /*
235 * Get the human-readable name of a specific audio device. 242 * Get the human-readable name of a specific audio device.
236 * Must be a value between 0 and (number of audio devices-1). 243 * Must be a value between 0 and (number of audio devices-1).
237 * Only valid after a successfully initializing the audio subsystem. 244 * Only valid after a successfully initializing the audio subsystem.
238 * The values returned by this function reflect the latest call to 245 * The values returned by this function reflect the latest call to
239 * SDL_GetNumAudioDevices(); recall that function to redetect available 246 * SDL_GetNumAudioDevices(); recall that function to redetect available
240 * hardware. 247 * hardware.
248 *
249 * The string returned by this function is UTF-8 encoded, read-only, and
250 * managed internally. You are not to free it. If you need to keep the
251 * string for any length of time, you should make your own copy of it, as it
252 * will be invalid next time any of several other SDL functions is called.
241 */ 253 */
242 extern DECLSPEC const char *SDLCALL SDL_GetAudioDevice(int index, 254 extern DECLSPEC const char *SDLCALL SDL_GetAudioDevice(int index,
243 int iscapture); 255 int iscapture);
244 256
245 257
246 /* 258 /*
247 * Open a specific audio device. Passing in a device name of NULL is 259 * Open a specific audio device. Passing in a device name of NULL requests
248 * equivalent to SDL_OpenAudio(). Returns 0 on error, a valid device ID 260 * the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
249 * on success. SDL_OpenAudio(), unlike this function, always acts on device 261 * The device name is a UTF-8 string reported by SDL_GetAudioDevice(), but
250 * ID 1. 262 * some drivers allow arbitrary and driver-specific strings, such as a
263 * hostname/IP address for a remote audio server, or a filename in the
264 * diskaudio driver.
265 * Returns 0 on error, a valid device ID that is >= 2 on success.
266 * SDL_OpenAudio(), unlike this function, always acts on device ID 1.
251 */ 267 */
252 extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char 268 extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
253 *device, 269 *device,
254 int iscapture, 270 int iscapture,
255 const 271 const