-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.h
51 lines (41 loc) · 1.22 KB
/
globals.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
// File name: globals.h
#ifndef GLOBALS_H_
#define GLOBALS_H_
#include <stdint.h>
#include <deque>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <vector>
#include "Objects.h"
// Some global variables
const long FS = 48000;
const int B = 0.01*FS;
const int H = 4;
const int SAMPLE_QUEUE_SIZE = B * H;
const long long SILENCE_TO_RESET_SAMPLES = 4*FS;
const int SILENCE_THRESHOLD_POSITIVE = -80;
const int SILENCE_THRESHOLD_NEGATIVE = -90;
const int m = 3;
const int l = 3;
const int AMPLITUDE_THRESHOLD = 3000; // Need to set to proper value
const int SLOPE_THRESHOLD = 2; // Need to set to proper value
// External stuff necessary to score
extern std::vector<Cluster > clusters_max;
extern Agent* highest_score_agent;
extern bool agents_start;
extern std::deque<Onset> onsets;
extern std::vector<Cluster *> clusters;
extern float averageIOI;
extern int bestScore;
// Receive samples as 16 bit signed integers
extern std::deque<int16_t> SAMPLE_QUEUE;
// Queue to store the RMS values
extern std::deque<double> RMS_AMPLITUDE;
// Represents slopes at the corresponging RMS_AMPLITUDE indexes
extern std::deque<double> SLOPES;
extern std::deque<Onset> ONSETS;
#endif