-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathAudioInput.h
65 lines (55 loc) · 1.88 KB
/
AudioInput.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef AUDIOINPUT_H
#define AUDIOINPUT_H
#define WAVEHDRBUFFER 4
#define MAXNUMPTS 2*192*10 // 192kHz
extern int SAMPPERMS;
// For debugging
//#define NUMPTS 2*SAMP // stereo * 10 * SAMP
//extern float decoded[1024][2];
extern int audio_delay;
//extern volatile float gamma[4];
extern int sampleRate;
extern int IFREQ;
extern volatile double audioRefLevel;
extern double audio_volume_reflection;
extern double audio_phase_reflection;
extern double audio_volume_transmission;
extern double audio_phase_transmission;
extern bool audio_simulation;
extern unsigned int selectedAudio;
extern int OpenAudio (void);
extern void ArmAudio(int pM, System::IO::Ports::SerialPort^ port);
void MarkFrequency(unsigned long freq);
void MarkFrequency(void);
extern bool RetreiveData(int i, int duration, float& m, float& p, float& tm, float& tp, float& r, unsigned long& fr,int avSamp);
extern void StartAudioSimulation(int mode, int numPoints, int duration, __int64 startF, __int64 stepF,int cable_before, int cable_after, int direction, int r, int c, int sc, int l, float n);
extern void SetAudioPower(int power);
extern void DumpMeasurement(System::String ^);
extern void GetMixerInfo();
extern int MixerGetVolume(void);
extern void MixerSetVolume(int);
#define SUMTYPE float
typedef struct measurementType {
float magnitude;
float phase;
float reference;
float delta;
unsigned long freq;
float dcr;
float dcs;
int read;
SUMTYPE samp_s;
SUMTYPE samp_c;
SUMTYPE ref_s;
SUMTYPE ref_c;
int force;
int average;
} measurementType;
// Max gridsize = 1024, 1040 gives some extra data slots. 100 ms measurement means more then 200 samples point
#define MAX_MEASUREMENTS 1040*300
extern volatile measurementType measured[MAX_MEASUREMENTS];
extern volatile int measurementIndex[1100];
extern volatile int lastMeasurement;
extern volatile measurementType actualMeasurement;
extern volatile int nextDecoded;
#endif