Audio I/O device interface.
More...
#include <audiosources.h>
|
char const * | get_id (void) |
| Returns a unique identifier string representing the audio device.
|
char const * | get_name (void) |
| Returns a human readable name of the audio device.
|
gate_intptr_t | get_handle (void) |
| Returns the system native device handle representing the audio device.
|
gate_enumint_t | get_device_type (void) |
| Returns a device type to identify input and/or output capabilities.
|
gate_size_t | get_supported_formats (gate_audio_format_t *format_buffer, gate_size_t format_buffer_capacity) |
| Fills a buffer with support audio formats that can be processed by an opened device.
|
gate_result_t | open (gate_audio_format_t const *format, gate_size_t sample_count) |
| Opens an audio device to process the requested data format.
|
gate_result_t | close (void) |
| Closes an opened audio device and cancels any active processing tasks.
|
gate_result_t | read (gate_audio_sample_t *sample) |
| Reads a single audio sample from the opened device.
|
gate_result_t | read_async (gate_delegate_t const *completion) |
| Reads a single audio sample from the opened device in a background task.
|
gate_result_t | write (gate_audio_sample_t const *sample) |
| Writes a single audio sample to an opened device.
|
gate_result_t | write_async (gate_audio_sample_t const *sample, gate_delegate_t const *completion) |
| Writes a single audio sample to an opened device in a background task.
|
char const * | get_interface_name () |
| Returns on object's interface path name.
|
void | release () |
| Decrease object's reference counter, releases the object when count reaches zero.
|
int | retain () |
| Increase object's reference counter.
|
Audio I/O device interface.
◆ get_id()
char const * get_id |
( |
void | | ) |
|
Returns a unique identifier string representing the audio device.
- Returns
- C-string pointer to identifier
◆ get_name()
char const * get_name |
( |
void | | ) |
|
Returns a human readable name of the audio device.
- Returns
- C-string pointer to name
◆ get_handle()
gate_intptr_t get_handle |
( |
void | | ) |
|
Returns the system native device handle representing the audio device.
- Returns
- Native handle identifier
◆ get_device_type()
Returns a device type to identify input and/or output capabilities.
- Returns
- gate_audio_device_type_t value
◆ get_supported_formats()
Fills a buffer with support audio formats that can be processed by an opened device.
- Parameters
-
[in,out] | format_buffer | Pointer to first entry in format buffer array |
[in] | format_buffer_capacity | Maximum usable amount of entries in format buffer array |
- Returns
- Amount of filled entries in buffer
◆ open()
Opens an audio device to process the requested data format.
- Parameters
-
[in] | format | Pointer to format definition of audio samples to process |
[in] | sample_count | Default length of a single processed audio record in data-samples count |
- Returns
- GATE_RESULT_* result code
◆ close()
Closes an opened audio device and cancels any active processing tasks.
- Returns
- GATE_RESULT_* result code
◆ read()
Reads a single audio sample from the opened device.
- Parameters
-
[in,out] | sample | Pointer to sample object to be filled with audio data |
- Returns
- GATE_RESULT_* result code
◆ read_async()
Reads a single audio sample from the opened device in a background task.
- Parameters
-
[in] | completion | callback to be invoked with the filled sample when reading is complete |
- Returns
- GATE_RESULT_* result code
◆ write()
Writes a single audio sample to an opened device.
- Parameters
-
[in] | sample | Pointer to audio sample to be sent to the device |
- Returns
- GATE_RESULT_* result code
◆ write_async()
gate_result_t write_async |
( |
gate_audio_sample_t const * | sample, |
|
|
gate_delegate_t const * | completion ) |
Writes a single audio sample to an opened device in a background task.
- Parameters
-
[in] | sample | Pointer to sample to be sent to output device |
[in] | completion | Callback to be invoked when the write operation has completed |
- Returns
- GATE_RESULT_* result code
The documentation for this interface was generated from the following file: