GNUnet  0.11.x
gnunet_microphone_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2013 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
33 #ifndef GNUNET_MICROPHONE_SERVICE_H
34 #define GNUNET_MICROPHONE_SERVICE_H
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #if 0 /* keep Emacsens' auto-indent happy */
40 }
41 #endif
42 #endif
43 
44 #include "gnunet_util_lib.h"
45 
53 typedef void (*GNUNET_MICROPHONE_RecordedDataCallback)(void *cls,
54  size_t data_size,
55  const void *data);
56 
65 typedef int (*GNUNET_MICROPHONE_EnableCallback)(void *cls,
67  rdc,
68  void *rdc_cls);
69 
75 typedef void (*GNUNET_MICROPHONE_DisableCallback)(void *cls);
76 
82 typedef void (*GNUNET_MICROPHONE_DestroyCallback)(void *cls);
83 
84 
89 {
94 
99 
104 
108  void *cls;
109 };
110 
111 
122 
123 
129 void
131 
132 
133 #if 0 /* keep Emacsens' auto-indent happy */
134 {
135 #endif
136 #ifdef __cplusplus
137 }
138 #endif
139 
140 #endif
141  /* end of group */
143 
144 /* end of gnunet_microphone_lib.h */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
GNUNET_MICROPHONE_DisableCallback disable_microphone
Turn the microphone off.
static size_t data_size
Number of bytes in data.
Definition: gnunet-abd.c:187
void(* GNUNET_MICROPHONE_RecordedDataCallback)(void *cls, size_t data_size, const void *data)
Process recorded audio data.
GNUNET_MICROPHONE_EnableCallback enable_microphone
Turn on the microphone.
void(* GNUNET_MICROPHONE_DestroyCallback)(void *cls)
Function to destroy a microphone.
void(* GNUNET_MICROPHONE_DisableCallback)(void *cls)
Function that disables a microphone.
GNUNET_MICROPHONE_DestroyCallback destroy_microphone
Destroy the microphone.
void * cls
Closure for the callbacks.
void GNUNET_MICROPHONE_destroy(struct GNUNET_MICROPHONE_Handle *microphone)
Destroy a microphone.
Definition: microphone.c:193
configuration data
Definition: configuration.c:85
A microphone is a device that can capture or otherwise produce audio data.
int(* GNUNET_MICROPHONE_EnableCallback)(void *cls, GNUNET_MICROPHONE_RecordedDataCallback rdc, void *rdc_cls)
Enable a microphone.
uint32_t data
The data value.
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.
Definition: microphone.c:170
static struct GNUNET_MICROPHONE_Handle * microphone
Handle to the microphone.