GATE
C/C++ Framework
Loading...
Searching...
No Matches
gate_audio_device_t Interface Reference

Audio I/O device interface. More...

#include <audiosources.h>

Inheritance diagram for gate_audio_device_t:
gate_object_t

Public Member Functions

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.
Public Member Functions inherited from gate_object_t
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.

Detailed Description

Audio I/O device interface.

Member Function Documentation

◆ 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()

gate_enumint_t get_device_type ( void )

Returns a device type to identify input and/or output capabilities.

Returns
gate_audio_device_type_t value

◆ get_supported_formats()

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.

Parameters
[in,out]format_bufferPointer to first entry in format buffer array
[in]format_buffer_capacityMaximum usable amount of entries in format buffer array
Returns
Amount of filled entries in buffer

◆ open()

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.

Parameters
[in]formatPointer to format definition of audio samples to process
[in]sample_countDefault length of a single processed audio record in data-samples count
Returns
GATE_RESULT_* result code

◆ close()

gate_result_t close ( void )

Closes an opened audio device and cancels any active processing tasks.

Returns
GATE_RESULT_* result code

◆ read()

gate_result_t read ( gate_audio_sample_t * sample)

Reads a single audio sample from the opened device.

Parameters
[in,out]samplePointer to sample object to be filled with audio data
Returns
GATE_RESULT_* result code

◆ read_async()

gate_result_t read_async ( gate_delegate_t const * completion)

Reads a single audio sample from the opened device in a background task.

Parameters
[in]completioncallback to be invoked with the filled sample when reading is complete
Returns
GATE_RESULT_* result code

◆ write()

gate_result_t write ( gate_audio_sample_t const * sample)

Writes a single audio sample to an opened device.

Parameters
[in]samplePointer 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]samplePointer to sample to be sent to output device
[in]completionCallback 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: