SAL
A C++ library for spatial audio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cipicmic.h
Go to the documentation of this file.
1 /*
2  cipicmic.h
3  Spatial Audio Library (SAL)
4  Copyright (c) 2015, Enzo De Sena
5  All rights reserved.
6 
7  Authors: Enzo De Sena, enzodesena@gmail.com
8 
9  */
10 
11 #ifndef SAL_CIPICMIC_H
12 #define SAL_CIPICMIC_H
13 
14 #include <map>
15 #include <vector>
16 #include "microphone.h"
17 #include "quaternion.h"
18 #include "saltypes.h"
19 #include "array.h"
20 #include "binauralmic.h"
21 #include "salconstants.h"
22 
23 #define NUM_ELEVATIONS_CIPIC 50
24 #define LENGTH_BRIR_CIPIC 200
25 #define NORMALISING_VALUE_CIPIC 1.0
26 
27 namespace sal {
28 
29 
30 
31 class CipicMic : public DatabaseBinauralMic {
32 public:
33 
34  enum DataType {
35  txt,
37  };
38 
43  CipicMic(const mcl::Point& position, const mcl::Quaternion& orientation,
44  const std::string& directory, const DataType data_type,
45  const Int update_length = 0);
46 
49 
50  static bool Test();
51 
52  ~CipicMic() {}
53 
54 
55 private:
56  static std::vector<std::vector<Signal> > Load(const Ear ear,
57  const std::string& directory,
58  const DataType data_type,
59  const std::vector<sal::Angle>& azimuths);
60 
61  virtual Signal GetBrir(const Ear ear, const mcl::Point& point) noexcept;
62 
63  std::vector<sal::Angle> azimuths_;
64 
65 };
66 
67 
68 
69 } // namespace sal
70 
71 #endif