API to access an audio speaker; provides access to hardware speakers. More...
Go to the source code of this file.
Data Structures | |
| struct | Speaker |
| Internal data structures for the speaker. More... | |
Functions | |
| static int | enable (void *cls) |
| Function that enables a speaker. | |
| static void | disable (void *cls) |
| Function that disables a speaker. | |
| static void | destroy (void *cls) |
| Function to destroy a speaker. | |
| static void | play (void *cls, size_t data_size, const void *data) |
| Function to cause a speaker to play audio data. | |
| struct GNUNET_SPEAKER_Handle * | GNUNET_SPEAKER_create_from_hardware (const struct GNUNET_CONFIGURATION_Handle *cfg) |
| Create a speaker that corresponds to the speaker hardware of our system. | |
| void | GNUNET_SPEAKER_destroy (struct GNUNET_SPEAKER_Handle *speaker) |
| Destroy a speaker. | |
API to access an audio speaker; provides access to hardware speakers.
Definition in file speaker.c.
|
static |
Function that enables a speaker.
| cls | closure with the struct Speaker |
Definition at line 58 of file speaker.c.
References _, GNUNET_ERROR_TYPE_ERROR, GNUNET_HELPER_start(), GNUNET_log, GNUNET_NO, GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_SYSERR, and Speaker::playback_helper.
Referenced by GNUNET_SPEAKER_create_from_hardware().
|
static |
Function that disables a speaker.
| cls | closure with the struct Speaker |
Definition at line 88 of file speaker.c.
References GNUNET_break, GNUNET_HELPER_destroy(), GNUNET_HELPER_kill(), GNUNET_NO, GNUNET_OK, and Speaker::playback_helper.
Referenced by destroy(), and GNUNET_SPEAKER_create_from_hardware().
|
static |
Function to destroy a speaker.
| cls | closure with the struct Speaker |
Definition at line 110 of file speaker.c.
References disable(), and Speaker::playback_helper.
Referenced by GNUNET_SPEAKER_create_from_hardware().
|
static |
Function to cause a speaker to play audio data.
| cls | clsoure with the struct Speaker |
| data_size | number of bytes in data |
| data | audio data to play, format is opaque to the API but should be OPUS. |
Definition at line 128 of file speaker.c.
References data, data_size, GNUNET_break, GNUNET_HELPER_send(), GNUNET_memcpy, GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO, GNUNET_NO, AudioMessage::header, Speaker::playback_helper, GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by GNUNET_SPEAKER_create_from_hardware().