-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
38 lines (24 loc) · 1.49 KB
/
run.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
36
37
38
from word_recognition import recognize_word
from similar_speaker import find_similar_speaker
from utils import print_results
if __name__ == '__main__':
DB_PATH = "sound_database"
REF_NAME = '38-21'
print("Results on a word from a speaker who's sounds are in the dataset, but the said word is not in the dataset vocabulary:")
INPUT_FILE = "test.wav"
recognized_word, top_word, dtw_res = recognize_word(INPUT_FILE, DB_PATH)
print_results(recognized_word, top_word, dtw_res)
print("\nResults on a word from a speaker who's sounds are not in the dataset, but the said word is in the dataset vocabulary:")
INPUT_FILE = 'desno-test.wav'
recognized_word, top_word, dtw_res = recognize_word(INPUT_FILE, DB_PATH)
print_results(recognized_word, top_word, dtw_res)
print("\nResults on a word from a speaker who's sounds are in the dataset and the said word is in the dataset vocabulary:")
INPUT_FILE = 'levo-test.wav'
recognized_word, top_word, dtw_res = recognize_word(INPUT_FILE, DB_PATH)
print_results(recognized_word, top_word, dtw_res)
print('\nSimilar speaker to speaker named 38-21 based on MFCC:')
print(find_similar_speaker(REF_NAME, DB_PATH, feature_type='mfcc'))
print('\nSimilar speaker to speaker named 38-21 based on Mel Spec:')
print(find_similar_speaker(REF_NAME, DB_PATH, feature_type='mel'))
print('\nSimilar speaker to speaker named 38-21 based on LPC:')
print(find_similar_speaker(REF_NAME, DB_PATH, feature_type='lpc'))