Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Fix #2929: use returned TTS audio file path #2934

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

krisgesling
Copy link
Contributor

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?

  • CLA

@pep8speaks
Copy link

pep8speaks commented Jun 28, 2021

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

@devops-mycroft devops-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Jun 28, 2021
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

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
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

1 similar comment
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@krisgesling krisgesling merged commit 6099da1 into dev Jun 29, 2021
@krisgesling krisgesling deleted the bugfix/tts-audio-file-path branch June 29, 2021 21:33
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 1, 2021
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:
Copy link
Contributor

@JarbasAl JarbasAl Jul 1, 2021

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
Copy link
Contributor

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

JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 1, 2021
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
@krisgesling krisgesling restored the bugfix/tts-audio-file-path branch July 1, 2021 21:10
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 5, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 5, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 5, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 6, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 6, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 6, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
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
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 9, 2021
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tts discarding path
5 participants