Access hardware audio speakers. More...
Data Structures | |
| struct | GNUNET_SPEAKER_Handle |
| A speaker is a device that can play or record audio data. More... | |
Typedefs | |
| typedef int(* | GNUNET_SPEAKER_EnableCallback) (void *cls) |
| Function that enables a speaker. | |
| typedef void(* | GNUNET_SPEAKER_DisableCallback) (void *cls) |
| Function that disables a speaker. | |
| typedef void(* | GNUNET_SPEAKER_DestroyCallback) (void *cls) |
| Function to destroy a speaker. | |
| typedef void(* | GNUNET_SPEAKER_PlayCallback) (void *cls, size_t data_size, const void *data) |
| Function to cause a speaker to play audio data. | |
Functions | |
| 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. | |
Access hardware audio speakers.
| typedef int(* GNUNET_SPEAKER_EnableCallback) (void *cls) |
Function that enables a speaker.
| cls | closure |
Definition at line 56 of file gnunet_speaker_lib.h.
| typedef void(* GNUNET_SPEAKER_DisableCallback) (void *cls) |
Function that disables a speaker.
| cls | closure |
Definition at line 63 of file gnunet_speaker_lib.h.
| typedef void(* GNUNET_SPEAKER_DestroyCallback) (void *cls) |
Function to destroy a speaker.
| cls | closure |
Definition at line 70 of file gnunet_speaker_lib.h.
Function to cause a speaker to play audio data.
| cls | closure |
| 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 80 of file gnunet_speaker_lib.h.
| 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.
| cfg | configuration to use |
Definition at line 160 of file speaker.c.
References cfg, Speaker::cfg, GNUNET_SPEAKER_Handle::cls, destroy(), GNUNET_SPEAKER_Handle::destroy_speaker, disable(), GNUNET_SPEAKER_Handle::disable_speaker, enable(), GNUNET_SPEAKER_Handle::enable_speaker, GNUNET_new, play(), GNUNET_SPEAKER_Handle::play, and speaker.
Referenced by run(), and run().
| void GNUNET_SPEAKER_destroy | ( | struct GNUNET_SPEAKER_Handle * | speaker | ) |
Destroy a speaker.
| speaker | speaker to destroy |
Definition at line 184 of file speaker.c.
References GNUNET_SPEAKER_Handle::cls, GNUNET_SPEAKER_Handle::destroy_speaker, GNUNET_free, and speaker.
Referenced by do_shutdown(), and do_stop_task().