GNUnet 0.22.2

Provides access to hardware microphones. More...

Collaboration diagram for Microphone library:

Data Structures

struct  GNUNET_MICROPHONE_Handle
 A microphone is a device that can capture or otherwise produce audio data. More...
 

Typedefs

typedef void(* GNUNET_MICROPHONE_RecordedDataCallback) (void *cls, size_t data_size, const void *data)
 Process recorded audio data. More...
 
typedef int(* GNUNET_MICROPHONE_EnableCallback) (void *cls, GNUNET_MICROPHONE_RecordedDataCallback rdc, void *rdc_cls)
 Enable a microphone. More...
 
typedef void(* GNUNET_MICROPHONE_DisableCallback) (void *cls)
 Function that disables a microphone. More...
 
typedef void(* GNUNET_MICROPHONE_DestroyCallback) (void *cls)
 Function to destroy a microphone. More...
 

Functions

struct GNUNET_MICROPHONE_HandleGNUNET_MICROPHONE_create_from_hardware (const struct GNUNET_CONFIGURATION_Handle *cfg)
 Create a microphone that corresponds to the microphone hardware of our system. More...
 
void GNUNET_MICROPHONE_destroy (struct GNUNET_MICROPHONE_Handle *microphone)
 Destroy a microphone. More...
 

Detailed Description

Provides access to hardware microphones.

Typedef Documentation

◆ GNUNET_MICROPHONE_RecordedDataCallback

typedef void(* GNUNET_MICROPHONE_RecordedDataCallback) (void *cls, size_t data_size, const void *data)

Process recorded audio data.

Parameters
clsclsoure
data_sizenumber of bytes in data
dataaudio data to play

Definition at line 57 of file gnunet_microphone_lib.h.

◆ GNUNET_MICROPHONE_EnableCallback

typedef int(* GNUNET_MICROPHONE_EnableCallback) (void *cls, GNUNET_MICROPHONE_RecordedDataCallback rdc, void *rdc_cls)

Enable a microphone.

Parameters
clsclsoure
rdcfunction to call with recorded data
rdc_clsclosure for dc
Returns
GNUNET_OK on success, GNUNET_SYSERR on error

Definition at line 69 of file gnunet_microphone_lib.h.

◆ GNUNET_MICROPHONE_DisableCallback

typedef void(* GNUNET_MICROPHONE_DisableCallback) (void *cls)

Function that disables a microphone.

Parameters
clsclsoure

Definition at line 79 of file gnunet_microphone_lib.h.

◆ GNUNET_MICROPHONE_DestroyCallback

typedef void(* GNUNET_MICROPHONE_DestroyCallback) (void *cls)

Function to destroy a microphone.

Parameters
clsclsoure

Definition at line 86 of file gnunet_microphone_lib.h.

Function Documentation

◆ GNUNET_MICROPHONE_create_from_hardware()

struct GNUNET_MICROPHONE_Handle * GNUNET_MICROPHONE_create_from_hardware ( const struct GNUNET_CONFIGURATION_Handle cfg)

Create a microphone that corresponds to the microphone hardware of our system.

Parameters
cfgconfiguration to use
Returns
NULL on error

Definition at line 172 of file microphone.c.

174{
176 struct Microphone *mic;
177
178 mic = GNUNET_new (struct Microphone);
179 mic->cfg = cfg;
181 microphone->cls = mic;
185 return microphone;
186}
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
static struct GNUNET_MICROPHONE_Handle * microphone
Handle to the microphone.
static struct GNUNET_MICROPHONE_Handle * mic
Our microphone.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static void disable(void *cls)
Function that disables a microphone.
Definition: microphone.c:133
static int enable(void *cls, GNUNET_MICROPHONE_RecordedDataCallback rdc, void *rdc_cls)
Enable a microphone.
Definition: microphone.c:99
static void destroy(void *cls)
Function to destroy a microphone.
Definition: microphone.c:155
A microphone is a device that can capture or otherwise produce audio data.
void * cls
Closure for the callbacks.
GNUNET_MICROPHONE_DisableCallback disable_microphone
Turn the microphone off.
GNUNET_MICROPHONE_DestroyCallback destroy_microphone
Destroy the microphone.
GNUNET_MICROPHONE_EnableCallback enable_microphone
Turn on the microphone.
Internal data structures for the microphone.
Definition: microphone.c:39

References cfg, GNUNET_MICROPHONE_Handle::cls, destroy(), GNUNET_MICROPHONE_Handle::destroy_microphone, disable(), GNUNET_MICROPHONE_Handle::disable_microphone, enable(), GNUNET_MICROPHONE_Handle::enable_microphone, GNUNET_new, mic, and microphone.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_MICROPHONE_destroy()

void GNUNET_MICROPHONE_destroy ( struct GNUNET_MICROPHONE_Handle microphone)

Destroy a microphone.

Parameters
microphonemicrophone to destroy

Definition at line 195 of file microphone.c.

196{
199}
#define GNUNET_free(ptr)
Wrapper around free.

References GNUNET_MICROPHONE_Handle::cls, GNUNET_MICROPHONE_Handle::destroy_microphone, GNUNET_free, and microphone.

Referenced by do_shutdown(), and do_stop_task().

Here is the caller graph for this function: