Commit Graph

25 Commits (dev)

Author SHA1 Message Date
Åke e7ddd51256
TTS playback queue singleton (#3055)
* fix issues when remote excepts out

* Remove explicit clear_cache from MimicTTS

* Updates for using singleton TTS playback thread

- Cache is called on all tts's registered as using the thread
- Begin audio and end audio is handled by the playback thread
- Further changes from self.playback to TTS.playback for consistency

* Remove redundant try/except

* Consolidate general and TTS-specific sentence splitting

This performs all sentence-splitting at the same stage. This fixes a
subtle issue where a TTS splits a sentence into chunks and throws an
error on only one of those chunks. The fallback would generate a
sentence for the original un-chunked sentence. possibly saying the same
parts twice.

This also pre-compiles the regexes used to speed things up a bit.

Co-authored-by: Ken <ken.smith@mycroft.ai>
2022-03-02 09:59:57 +09:30
Åke Forslund 0ae02b5939 Fix TTS using the returned path 2021-07-02 08:34:03 +02:00
Kris Gesling 0394568704 Use returned TTS audio file path
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
2021-06-29 21:53:53 +09:30
Åke Forslund 4799caa696 Add test cases for tts cache __contains__ 2021-06-10 09:33:12 +02:00
Åke Forslund 5d68309523 Refactor mimic_tts to not load config when importing
Hitting the entire configuration fetching routine with call to the
backend is not polite to do when just importing the file. This moves the
config lookup out of the global scope and into special functions for
finding the mimic binary and looking up the data path for the subscriber
voices.
2021-04-28 22:31:10 +02:00
Åke Forslund bea3bac2bf Make mimic get_tts() return phonemes pre-parsed
This makes the phonemes json de/encodable like mimic2
2021-04-05 08:28:38 +02:00
Åke Forslund 0b857e92f9 Sync tts cache dict of cached sentences on curate
This will make sure the dict of caches gets updated when curate_cache
removes files.
2021-03-21 13:33:08 +01:00
Åke Forslund 9b4544dc7d Move cache curation to TextToSpeechCache 2021-03-18 23:02:26 +01:00
Chris Veilleux ea013b26af Fixed failing unit test. 2021-03-10 21:16:34 -06:00
Chris Veilleux 86febca6a3 Fixed a bug passing None to an instance of Path 2021-03-10 15:35:38 -06:00
Chris Veilleux 5e90940896 new code to consolidate TTS cache handling into one module. 2021-03-10 13:38:17 -06:00
Kris Gesling fa5576adf4
Merge pull request #2831 from MycroftAI/bugfix/google-voice
Upgrade gTTS to fix Google voice
2021-02-10 11:16:43 +09:30
Kris Gesling c8494932ac Remove deprecated Google TTS lang codes 2021-02-09 21:27:59 +09:30
Åke Forslund 9173e22460 Send correct conf to mimic when used as fallback
- Mimic is now sent the correct config when used as a fallback
- Tests updated to ensure this
2021-02-08 22:09:55 +01:00
Åke Forslund 86a978fadf Fix audio service startup without Internet
If started up without Network connection the audio service would crash
importing the google_tts module as it tried to fetch language list from
google.

This restructures it to be a just-in-time check. It also adds a cached
list of supported languages to use if an error occurs fetching language
codes.

A small fix allowing "en-US" to be matched to "en-us" instead of the
generic "en" is also included.
2020-05-27 21:28:26 +02:00
Åke Forslund 094c2c28d0 Test loading of phonetic spelling dictionary
This also normalizes the path slightly to make sure that the phonetic
spelling is loaded even if the lang code contains capitals.
2020-05-12 08:58:18 +02:00
Åke Forslund 8c0aca6d4c Fix typo in mimic test case
An underscore instead of a . made the subprocess check output always
pass.
2020-05-11 21:43:28 +02:00
Åke Forslund 4d065ff7fe Add basic unittest for espeak 2020-05-11 16:14:24 +02:00
Åke Forslund 22b21d1773 Add test case for Server error 2020-02-17 15:11:55 +01:00
Åke Forslund b581766a00 Fallback to mimic for bad http status codes
Added a RemoteTTSException exception for non-timeout exceptions, Mimic2
will consider HTTP status code 200-299 as OK while other responses will
trigger raise RemoteTTSException.
2020-02-17 15:08:21 +01:00
Åke Forslund eb3250fe90 Add more TTS tests
- Tests for TTS base class
- Test for TTS playback queue
- Test for TTS Factory create
- Tests for Mimic2 TTS
- Tests for Mimic TTS
- Tests for Google TTS
2020-01-10 16:26:48 +01:00
maxbachmann c058633dd5 improve test runtime 2019-11-30 10:22:59 +01:00
Åke Forslund 1400af2b16 Fix pycodestyle errors 2019-05-15 13:46:43 +02:00
Matthew D. Scholefield cbf73d4b30 SSML Changes
- Engines now specify if they support ssml rather than the configuration
 - The text client strips out ssml tags
 - Engines can modify tags via the `self.modify_tag` method
2018-04-18 14:45:09 -05:00
Jarbas 7c6af2017c add SSML support 2018-04-18 14:45:09 -05:00