-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
42 lines (34 loc) · 1.59 KB
/
main.cpp
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
#include <iostream>
#include "yaacrl.h"
int main() {
Yaacrl y("root", "tassadar");
//std::cout << "ADD BRAD: " << y.add_file("audio/brad.wav") << std::endl;
std::cout << "ADD grob: " << y.add_file("audio/met.wav") << std::endl;
//int res = y.recognize_wav("audio/brad_cut.wav");
//std::cout << "RECOGN BRAD: " << y.get_song_by_id(res)<< std::endl;
//y.clear_database();
//y.fingerprints_to_file("audio/brad_cut.wav");
//std::map<std::string, int> res = y.recognize_fingerprints("audio/brad.wav.fingerprints");
std::map<std::string, int> res = y.recognize_wav("audio/met_105.wav");
std::cout << "RECOGN 105: \n";
std::cout << "\n\tID: " << res["id"];
std::cout << "\n\tOffset" << res["offset"];
std::cout << "\n\tMatch %: " << res["percentage"] << std::endl;
res = y.recognize_wav("audio/met_120.wav");
std::cout << "RECOGN 120: \n";
std::cout << "\n\tID: " << res["id"];
std::cout << "\n\tOffset" << res["offset"];
std::cout << "\n\tMatch %: " << res["percentage"] << std::endl;
res = y.recognize_wav("audio/snaar_cut.wav");
std::cout << "RECOGN SNAAR CUT: \n";
std::cout << "\n\tID: " << res["id"];
std::cout << "\n\tOffset" << res["offset"];
std::cout << "\n\tMatch %: " << res["percentage"] << std::endl;
res = y.recognize_wav("audio/rick_75.wav");
std::cout << "RECOGN rick 75: \n";
std::cout << "\n\tID: " << res["id"];
std::cout << "\n\tOffset" << res["offset"];
std::cout << "\n\tMatch %: " << res["percentage"] << std::endl;
//y.recognize_fingerprints("audio/brad.wav.fingerprints");
return 0;
}