AlHo Tuner
MicManager.h
1 
2 #ifndef MICMANAGER_H
3 #define MICMANAGER_H
4 #include <string.h>
5 #include <iostream>
6 #include "/usr/include/alsa/asoundlib.h"
7 
8 
9 class MicManager {
10 
11  public:
12  MicManager(short bufferSizeMatrix, int totalBufferSize, long int sampleFreq);
13  void readBuffer();
14  void closeDev();
15  void populateTotalBuffer();
16  void setBufferSize(int size);
17  void setTotalBufferSize(int size);
18  void setSampleRate(long int sr);
19  void openDev();
20  void setDev(int sr);
21 
22  short *getBuffer();
23  short *getTotalBuffer();
24  short getMaxima(double *t);
25 
26 
27 
28  private:
29 
30  int index = 0;
31  int err_code;
32  int buffer_size;
33  int total_buffer_size;
34  long int sample_rate;
35 
36  short *buffer;
37  short *total_buffer;
38 
39  const char *device = "default";
40  snd_pcm_t *handle_capture;
41  snd_pcm_sframes_t frames;
42 
43 };
44 
45 #endif /* MICMANAGER_H */
46 
Permite la captura de micrófono a través de API de ALSA.
Definition: MicManager.h:9