added mycroft thanks and print speaked dialogs (test)
This commit is contained in:
parent
d5ce1ae7fd
commit
06a4658326
@ -62,7 +62,8 @@ def is_music_playing():
|
|||||||
|
|
||||||
|
|
||||||
def best_confidence(title, query):
|
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
|
Some titles include ( Remastered 2016 ) and similar info. This method
|
||||||
will test the raw title and a version that has been parsed to remove
|
will test the raw title and a version that has been parsed to remove
|
||||||
such information.
|
such information.
|
||||||
@ -71,6 +72,8 @@ def best_confidence(title, query):
|
|||||||
query: query from user
|
query: query from user
|
||||||
Returns:
|
Returns:
|
||||||
(float) best condidence
|
(float) best condidence
|
||||||
|
|
||||||
|
Thanks to @Mycroft source code for this code
|
||||||
"""
|
"""
|
||||||
if query == 'None':
|
if query == 'None':
|
||||||
return SequenceMatcher(None, random_string_generator(5), random_string_generator(5)).ratio()
|
return SequenceMatcher(None, random_string_generator(5), random_string_generator(5)).ratio()
|
||||||
|
@ -9,6 +9,8 @@ def speak(sentence, client_ip, client_port):
|
|||||||
if raw_audio_bytes is None:
|
if raw_audio_bytes is None:
|
||||||
return "Error, audio not valid!"
|
return "Error, audio not valid!"
|
||||||
|
|
||||||
|
# TODO: remove when fixed opentts server
|
||||||
|
print(sentence)
|
||||||
play_audio_on_client(raw_audio_bytes, client_ip, client_port)
|
play_audio_on_client(raw_audio_bytes, client_ip, client_port)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user