XT-Audio
|
Service queries and device creation. More...
Go to the source code of this file.
Functions | |
XtServiceCaps | XtServiceGetCapabilities (XtService const *s) |
Get service capabilities. More... | |
XtError | XtServiceOpenDevice (XtService const *s, char const *id, XtDevice **device) |
Open an audio device. More... | |
XtError | XtServiceOpenDeviceList (XtService const *s, XtEnumFlags flags, XtDeviceList **list) |
Enumerate available devices. More... | |
XtError | XtServiceGetDefaultDeviceId (XtService const *s, XtBool output, XtBool *valid, char *buffer, int32_t *size) |
Get default device id. More... | |
XtError | XtServiceAggregateStream (XtService const *s, XtAggregateStreamParams const *params, void *user, XtStream **stream) |
Combines multiple audio devices into a single stream. More... | |
Service queries and device creation.
Contains functions to query service capabilities and open devices.
XtError XtServiceAggregateStream | ( | XtService const * | s, |
XtAggregateStreamParams const * | params, | ||
void * | user, | ||
XtStream ** | stream | ||
) |
Combines multiple audio devices into a single stream.
s | the audio service. |
params | the stream parameters. |
user | user data passed to the stream callbacks (may be NULL). |
stream | on success, receives a pointer to the opened audio stream. On error, *stream will be NULL. |
Each underlying stream is opened using the combination of the shared mix format and the device-specific channel specification as the audio format.
Aggregate streams use an intermediate buffer to keep underlying streams in sync. The total latency overhead of the aggregate stream is bounded by the largest buffer size of any of the underlying streams times a constant factor.
Use XtDeviceGetBufferSize to query supported buffer sizes. The resulting stream must be closed using XtStreamDestroy.
When the requested interleaving mode is not supported by any device it will be emulated.
The service must support stream aggregation (XtServiceCapsAggregation).
This function may only be called from the main thread.
XtServiceCaps XtServiceGetCapabilities | ( | XtService const * | s | ) |
Get service capabilities.
s | the audio service. |
This function may be called from any thread.
XtError XtServiceGetDefaultDeviceId | ( | XtService const * | s, |
XtBool | output, | ||
XtBool * | valid, | ||
char * | buffer, | ||
int32_t * | size | ||
) |
Get default device id.
s | the audio service. |
output | XtTrue for default output device, XtFalse for default input device |
valid | on success, *valid will be true if a default device is present |
buffer | the string buffer to receive the device id. If NULL, *size receives the required buffer size. |
size | the size of the buffer. |
It is NOT an error when no default device is present.
Open an audio device.
s | the audio service. |
id | the device id. |
device | on success, receives a pointer to the opened device. On error, *device is set to NULL. |
Use XtDeviceDestroy to clean up the device.
This function may only be called from the main thread.
XtError XtServiceOpenDeviceList | ( | XtService const * | s, |
XtEnumFlags | flags, | ||
XtDeviceList ** | list | ||
) |
Enumerate available devices.
s | the audio service. |
flags | specifies whether to enumerate input, output or all devices. |
list | on success, receives a pointer to the opened device list. On error, *list is set to NULL. |
Use XtDeviceListDestroy to clean up the device list.
This function may only be called from the main thread.