libPocuter 1.0 Support library for programming the Pocuter

PocuterMicrophone.h
Go to the documentation of this file.
1
2 #ifndef POCUTERMICROPHONE_H
3 #define POCUTERMICROPHONE_H
4 #include <stddef.h>
5
10 class PocuterMicrophone {
11 public:
12 enum MICERROR {
13 MICERROR_OK,
14 MICERROR_RESOURCE_NOT_AVAILABLE,
16 MICERROR_UNKNOWN,
17 };
18 enum MICEVENT {
19 MIC_DATA_PACKAGE
21 };
22 enum NOICE_REDUCTION_LEVEL {
23 REDUCTION_LEVEL_NONE,
24 REDUCTION_LEVEL_SMALL,
25 REDUCTION_LEVEL_MEDIUM,
26 REDUCTION_LEVEL_HIGHT,
27 REDUCTION_LEVEL_RAW,
29 };
30
31 enum SAMLE_RATE_HZ {
32 SAMLE_RATE_8000 = 8000,
33 SAMLE_RATE_11025 = 11025,
34 SAMLE_RATE_16000 = 16000,
35 SAMLE_RATE_22050 = 22050,
36 SAMLE_RATE_32000 = 32000,
37 SAMLE_RATE_44100 = 44100,
38 SAMLE_RATE_48000 = 48000
40 };
41
42
43 typedef void (micEventHandler)(MICEVENT, void* data, size_t dataSize, void* userData); /* Callback type definition */
44
57 virtual MICERROR registerEventHandler(micEventHandler* h, void* u) = 0;
58
63 virtual void unregisterEventHandler() = 0;
64
77 virtual MICERROR startRecording(SAMLE_RATE_HZ s, NOICE_REDUCTION_LEVEL n) = 0;
78
85 virtual MICERROR stopRecording() = 0;
86
87
88
89
90 private:
91
92 };
93
94
95
96
97
98 #endif /* POCUTERMICROPHONE_H */
99
PocuterMicrophone::SAMLE_RATE_11025
@ SAMLE_RATE_11025
Definition: PocuterMicrophone.h:33
PocuterMicrophone::SAMLE_RATE_44100
@ SAMLE_RATE_44100
Definition: PocuterMicrophone.h:37
PocuterMicrophone::SAMLE_RATE_48000
@ SAMLE_RATE_48000
Definition: PocuterMicrophone.h:38
PocuterMicrophone::stopRecording
virtual MICERROR stopRecording()=0
stop the recording
PocuterMicrophone::MICERROR_OK
@ MICERROR_OK
Definition: PocuterMicrophone.h:13
PocuterMicrophone::NOICE_REDUCTION_LEVEL
NOICE_REDUCTION_LEVEL
Definition: PocuterMicrophone.h:22
PocuterMicrophone::SAMLE_RATE_HZ
SAMLE_RATE_HZ
Definition: PocuterMicrophone.h:31
PocuterMicrophone::SAMLE_RATE_32000
@ SAMLE_RATE_32000
Definition: PocuterMicrophone.h:36
PocuterMicrophone::MICERROR_UNKNOWN
@ MICERROR_UNKNOWN
Definition: PocuterMicrophone.h:16
PocuterMicrophone::REDUCTION_LEVEL_RAW
@ REDUCTION_LEVEL_RAW
Definition: PocuterMicrophone.h:27
PocuterMicrophone::REDUCTION_LEVEL_SMALL
@ REDUCTION_LEVEL_SMALL
Definition: PocuterMicrophone.h:24
PocuterMicrophone::MIC_DATA_PACKAGE
@ MIC_DATA_PACKAGE
Definition: PocuterMicrophone.h:19
PocuterMicrophone::REDUCTION_LEVEL_NONE
@ REDUCTION_LEVEL_NONE
Definition: PocuterMicrophone.h:23
PocuterMicrophone::SAMLE_RATE_8000
@ SAMLE_RATE_8000
Definition: PocuterMicrophone.h:32
PocuterMicrophone::unregisterEventHandler
virtual void unregisterEventHandler()=0
unregister the event handler
PocuterMicrophone::MICERROR
MICERROR
Definition: PocuterMicrophone.h:12
PocuterMicrophone
options to access the Pocuter microphone
Definition: PocuterMicrophone.h:10
PocuterMicrophone::MICERROR_RESOURCE_NOT_AVAILABLE
@ MICERROR_RESOURCE_NOT_AVAILABLE
Definition: PocuterMicrophone.h:14
PocuterMicrophone::startRecording
virtual MICERROR startRecording(SAMLE_RATE_HZ s, NOICE_REDUCTION_LEVEL n)=0
start the recording
PocuterMicrophone::REDUCTION_LEVEL_MEDIUM
@ REDUCTION_LEVEL_MEDIUM
Definition: PocuterMicrophone.h:25
PocuterMicrophone::registerEventHandler
virtual MICERROR registerEventHandler(micEventHandler *h, void *u)=0
register an event callback
PocuterMicrophone::SAMLE_RATE_22050
@ SAMLE_RATE_22050
Definition: PocuterMicrophone.h:35
PocuterMicrophone::MICEVENT
MICEVENT
Definition: PocuterMicrophone.h:18
PocuterMicrophone::SAMLE_RATE_16000
@ SAMLE_RATE_16000
Definition: PocuterMicrophone.h:34
PocuterMicrophone::REDUCTION_LEVEL_HIGHT
@ REDUCTION_LEVEL_HIGHT
Definition: PocuterMicrophone.h:26
PocuterMicrophone::micEventHandler
void() micEventHandler(MICEVENT, void *data, size_t dataSize, void *userData)
Definition: PocuterMicrophone.h:43