AudiClean
SoxReader.h
Go to the documentation of this file.
1 #ifndef AUDICLEAN_WAVREADER_H
2 #define AUDICLEAN_WAVREADER_H
3 
4 #include <thread>
5 #include <stdio.h>
6 
7 #include "SampleLink.h"
8 
12 class SoxReader : public SampleLink{
13 public:
14  bool Open(int rate, int nchans, std::string globalopts, std::string fileopts, std::string filename);
15  std::thread * Start(int rate, int nchans, std::string globalopts, std::string fileopts, std::string filename);
16  void ForceStop();
17  void Run();
18  int GetNumChannels();
19  int GetSampleRate();
20  void SetOn(bool val);
21 
22 private:
23  bool isOn = true;
24  int nrChannels = 0;
25  int sampleRate = 0;
26  void NextSample(float sample);
27  FILE* pipe;
28  std::thread workerThread;
29  static int constexpr bufmax {64};
30  char rdbuf[bufmax];
31 };
32 
33 extern int get_wav_attr(std::string attr, std::string filename);
34 
35 #endif //AUDICLEAN_WAVREADER_H
get_wav_attr
int get_wav_attr(std::string attr, std::string filename)
Definition: SoxReader.cpp:27
SoxReader::ForceStop
void ForceStop()
Definition: SoxReader.cpp:93
SoxReader::GetSampleRate
int GetSampleRate()
Definition: SoxReader.cpp:111
SoxReader::Open
bool Open(int rate, int nchans, std::string globalopts, std::string fileopts, std::string filename)
Definition: SoxReader.cpp:52
SoxReader
Definition: SoxReader.h:12
SoxReader::SetOn
void SetOn(bool val)
Definition: SoxReader.cpp:68
SoxReader::Run
void Run()
Definition: SoxReader.cpp:75
SoxReader::Start
std::thread * Start(int rate, int nchans, std::string globalopts, std::string fileopts, std::string filename)
Definition: SoxReader.cpp:16
SoxReader::GetNumChannels
int GetNumChannels()
Definition: SoxReader.cpp:104