-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
36 lines (28 loc) · 876 Bytes
/
main.py
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
import os
from detecttunes.libfun import new_recognise_song
from detecttunes.recognise import recognise_song
# print(os.getcwd())
TEST_DIR = "test/ab/"
print(os.listdir(TEST_DIR))
"""
1. this code is used for testing
2. music fie in wav format compare with database fingerprint
correct = 0
for song in os.listdir(TEST_DIR):
print(correct)
result = new_recognise_song(TEST_DIR + song)
print(result)
result_title = result[2]
#song name contain recorded song name in this case it contain music name
if result_title == song:
correct += 1
print(correct)
else:
print(f"{song} - {result_title}")
print("--------")
print(f"{correct}/{len(os.listdir(TEST_DIR))}")"""
correct = 0
for song in os.listdir(TEST_DIR):
result = recognise_song(TEST_DIR + song)
print("Artist , Album , Title ")
print(result)