added mycroft thanks and print speaked dialogs (test)

This commit is contained in:
Mathieu 2021-08-28 16:28:35 +02:00
parent d5ce1ae7fd
commit 06a4658326
2 changed files with 6 additions and 1 deletions

View File

@ -62,7 +62,8 @@ def is_music_playing():
def best_confidence(title, query):
"""Find best match for a title against a query.
"""
Find best match for a title against a query.
Some titles include ( Remastered 2016 ) and similar info. This method
will test the raw title and a version that has been parsed to remove
such information.
@ -71,6 +72,8 @@ def best_confidence(title, query):
query: query from user
Returns:
(float) best condidence
Thanks to @Mycroft source code for this code
"""
if query == 'None':
return SequenceMatcher(None, random_string_generator(5), random_string_generator(5)).ratio()

View File

@ -9,6 +9,8 @@ def speak(sentence, client_ip, client_port):
if raw_audio_bytes is None:
return "Error, audio not valid!"
# TODO: remove when fixed opentts server
print(sentence)
play_audio_on_client(raw_audio_bytes, client_ip, client_port)