-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix #2929: use returned TTS audio file path #2934
Conversation
Hello @krisgesling! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-06-29 12:24:05 UTC |
Voight Kampff Integration Test Succeeded (Results) |
4a46881
to
168cb05
Compare
This reverts an unintentional breaking change. A TTS engine may return a different file path than was requested. This again uses the returned path but adds a deprecation warning that this behaviour will no longer be supported in an upcoming release. Fixes #2929
168cb05
to
0394568
Compare
Voight Kampff Integration Test Succeeded (Results) |
1 similar comment
Voight Kampff Integration Test Succeeded (Results) |
cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object
# TODO 21.08: remove mutation of audio_file.path. | ||
returned_file, phonemes = self.get_tts( | ||
sentence, str(audio_file.path)) | ||
if returned_file.path != audio_file.path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returned file is a string, not a cached object, this check will throw an exception
should be if returned_file != audio_file.path
"the maintainer of this plugin, please adhere to " | ||
"the file path argument provided. Modified paths " | ||
"will be ignored in a future release.")) | ||
audio_file = returned_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returned file is a string, not a cached object, should be audio_file.path = returned_file
cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object
cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object self.audio_ext code has been cleaned up, it is now detected instead of hard coded
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
hotfix/dynamic TTS audio extension engines (#60) self.audio_ext code has been cleaned up, it is now detected instead of hard coded tts engine has a default audio extension, but we can not be sure that the file actually uses the same extension, for instance in chatterbox a mp3 engine might include some cache in wav format, cached utterances might also be saved by the user in the resources directory hotfix/tts_cache (#61) fiX - MycroftAI#2934 was not a functional fix, get_tts returns a string not a cache object companion PR - MycroftAI#2938 cache was deleted on boot, the min_percent param is set to 100%, "Remove cache data if disk space is running low." actually means "always remove cache data". Value was made configurable (per tts engine) and defaults to 75% now
Description
This reverts an unintentional breaking change.
A TTS engine may return a different file path than was requested. This again uses the returned path but adds a deprecation warning that this behaviour will no longer be supported in an upcoming release.
Unless there are reasons why a TTS engine may need to save the files in an alternative location?
Fixes #2929
How to test
Updated unit test.
Test also throws the DeprecationWarning as the mocked value returned differs from the path requested.
Contributor license agreement signed?