104 static char *
const record_helper_argv[] = {
105 (
char*)
"gnunet-helper-audio-record",
113 "gnunet-helper-audio-record",
117 if (NULL ==
mic->record_helper)
120 _ (
"Could not start record audio helper\n"));
137 if (NULL ==
mic->record_helper)
145 mic->record_helper = NULL;
159 if (NULL !=
mic->record_helper)
struct GNUNET_MessageHeader * msg
constants for network protocols
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static struct GNUNET_MICROPHONE_Handle * microphone
Handle to the microphone.
static struct GNUNET_MICROPHONE_Handle * mic
Our microphone.
API to access an audio microphone; provides access to hardware microphones.
struct GNUNET_HELPER_Handle * GNUNET_HELPER_start(const struct GNUNET_OS_ProjectData *pd, int with_control_pipe, const char *binary_name, char *const binary_argv[], GNUNET_MessageTokenizerCallback cb, GNUNET_HELPER_ExceptionCallback exp_cb, void *cb_cls)
Starts a helper and begins reading from it.
enum GNUNET_GenericReturnValue GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill)
Sends termination signal to the helper process.
void GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h)
Free's the resources occupied by the helper handle.
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
#define GNUNET_log(kind,...)
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_ERROR
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_MICROPHONE_destroy(struct GNUNET_MICROPHONE_Handle *microphone)
Destroy a microphone.
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.
void(* GNUNET_MICROPHONE_RecordedDataCallback)(void *cls, size_t data_size, const void *data)
Process recorded audio data.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
#define GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO
Message to transmit the audio between helper and speaker/microphone library.
static int process_record_messages(void *cls, const struct GNUNET_MessageHeader *msg)
Function to process the audio from the record helper.
static void disable(void *cls)
Function that disables a microphone.
static int enable(void *cls, GNUNET_MICROPHONE_RecordedDataCallback rdc, void *rdc_cls)
Enable a microphone.
static void destroy(void *cls)
Function to destroy a microphone.
Message to transmit the audio (between client and helpers).
The handle to a helper process.
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.
struct GNUNET_HELPER_Handle * record_helper
Handle for the record helper.
void * rdc_cls
Closure for rdc.
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
GNUNET_MICROPHONE_RecordedDataCallback rdc
Function to call with audio data (if we are enabled).