Commit Graph

129 Commits (1faedf60529b78b0fe4c9961ab3ffd12100748e9)

Author SHA1 Message Date
Åke Forslund 8f6822278f Clean-up
tts.py:
- remove unused import
-remove unused variable
- init TTS thread enclosure member
mimic2_tts.py: Fix docstrings
mimic_tts: Fix docstrings and remove unused variables and imports
google_tts: Improve docstrings
2020-01-10 16:26:48 +01:00
Åke Forslund 93ff3d7651 Fix mimic2 text preprocessing 2020-01-10 16:26:48 +01:00
Åke Forslund 391b92ce56 Make Factory get Mimic TTS class from normal list
Removes duplicated code and makes method easier to test
2020-01-10 16:26:48 +01:00
Åke Forslund 72adf0465b Move code out of __init__.py 2020-01-10 15:27:07 +01:00
Ansgar Tuemmers c5b6987d0c Prepare for gTTS 2.1.0
Signature of gTTS.__init__ changes in 2.1.0 and breaks calls with
unnamed arguments like gTTS('some text', 'de')
2020-01-04 17:30:45 +01:00
Christian Clauss a1ff3fb355 Upgrade from pycodestyle to flake8 2019-11-19 23:07:52 +01:00
Åke Forslund c8328526b1 Fallback to Mimic if launch of TTS fails
Logs the exception and fallsback to Mimic as TTS backend if there is an
issue with the selected TTS backend or if the choice is invalid.
2019-10-28 14:20:01 +01:00
David Wagner ddad8d1569 Pass listen to end_audio() 2019-10-10 12:11:11 +00:00
David Wagner feac64b2b0 Add listen arg to other TTS classes 2019-10-10 12:09:50 +00:00
David Wagner d9523fd30f Pass listen to end_audio() 2019-10-10 11:54:58 +00:00
David Wagner e45f527af3 Default to False 2019-10-10 11:50:48 +00:00
Åke Forslund abf8a90f07 Add description of the playback thread loop 2019-10-04 15:14:56 +02:00
Åke Forslund 29db163a78 Move listen trigger to last chunk of sentence
If rendering a chunk of a sentence takes too long time, the audio queue
may run out and trigger the listening.

This moves the listening trigger to after the last chunk.
2019-10-04 15:09:45 +02:00
Kirill Kirilenko 58931310e9 Add Yandex TTS support 2019-09-30 20:13:04 +02:00
Andrew Kish 1d2cabd421 Fix missing param when setting up MaryTTS and how it validates a connection 2019-09-26 16:11:02 +02:00
David Wagner cf2791634d Fix bug where no utterance is spoken if cache wav is hit with no visemes cached 2019-09-11 18:44:31 +00:00
Åke Forslund 25bfd1345f Minor cleanup of tts/__init__.py
- Remove unused imports
- Correct docstrings
2019-08-31 14:27:06 +02:00
Åke Forslund 3d37315bc0 Utilize pulseaudio's corking/ducking feature
Pulseaudio allows corking / ducking for streams with prioritized roles
This sets the role for the mycroft speech to "phone" and all other to
"music" if the config tts->pulse_duck is set to true.
2019-08-31 14:27:06 +02:00
Christian Clauss 0053e70bc0
Undeefined name: Except --> Exception
__Except__ is an undefined name in this context with the potential to raise __NameError__ at runtime instead of the desired Exception and message.
2019-07-31 00:02:07 +02:00
Åke Forslund 39c844a257 Update old style metaclasses
the old "__metaclass__" has been ignored since the switch to python 3
this restores the metaclass functionality by updating it to the new
class kwarg syntax
2019-06-14 12:56:48 +02:00
Åke Forslund 1400af2b16 Fix pycodestyle errors 2019-05-15 13:46:43 +02:00
Åke Forslund 5ed417cddb Small style fixes
- Remove unneccessary pass
- Fix bare except statements
- Fix identation
2019-05-13 16:48:15 +02:00
Ruthvicp 90ccae2f69 Cache pre-loading for mimic2
When the mimic2 TTS instance is created the phrases from mycroft-core and mycroft-wifi setup (if available) is generated and stored locally (defaults to /opt/mycroft/preloaded_cache but can be changed with the mimic2 config parameter "preloaded_cache"

On startup the cache will be copied into the cache directory to speed up default interactions.
2019-05-13 14:33:30 +02:00
Ruthvicp ba305c5bfc separate the cache & avoid voice overlap
- The cache is now stored in a TTS specific directory
- Only a single fallback-tts is created
2019-03-28 10:40:02 +01:00
Åke 9eeb8cefc3 Fix mimic 2 long sentences (#2061)
* Fix mimic 2 long sentences

Fixes bug in  the second and third chunking pass incorrectly by
concatinating strings with lists resulting in chunks of single
characters.

* Handle mimic2 chunking correctly

- Move preprocessing from get_tts() to a method called from tts execute,
    this allows all parts to be spoken and the caching to work correctly
- Remove duplicate of phonetic spelling in mimic2_tts
2019-03-22 10:20:06 -05:00
Steve Penrod cd6db9f645 Bugfix for Mimic2 issues (#2043)
Mimic2 voices has several issues:
* Numeric generation was all goofed up for decimal numbers.  It was
  independently doing number to speech for the values before and after
  the period on a decimal number.  E.g. 1.100 became "one.one hundred".
  Removed local normalization altogether since it is handled
  correctly on the Mimic2 server now.
* Sentence splitting was being applied in the middle of things like
  numbers or abbreviations.  E.g. "I.B.M."
* Chunker algorithms were making unnecessary copies of string arrays

While in there I also:
* Removed several unused imports
* Cleaned up docstrings
* Prefixed private helpers with _
* Added debug logging of mimic2 request text
2019-03-07 14:55:31 -06:00
Luis Reinoso 62f0abf021 Issues-1982 - Add input validation 2019-02-27 10:39:22 +01:00
Luis Reinoso bb6de01e72 Issues-1982 - Add IAM authentication for Watson TTS 2019-02-27 10:39:05 +01:00
Åke 7674fa1c65
Merge pull request #1995 from MycroftAI/feature/settings-cleanup
Clean up some exception handling in settings code
2019-02-18 09:11:01 +01:00
Åke ba24cc3d78 Feature/remove old viseme system (#2000)
* Remove the old single viseme message

Instead a single viseme message is sent

* Correct the spelling of viseme.

Ref: https://en.wikipedia.org/wiki/Viseme

* Remove debug print.

This was probably left in by mistake, removing to clean up the audio log somewhat.
2019-02-17 23:54:59 -06:00
Steve Penrod a76c3a6e7a Quiet PEP8 2019-02-14 15:49:05 -06:00
Steve Penrod de818db9cb Clean up some exception handling in settings code
The settings code worked, but was noisy and generally messy about
a few exceptional but common situations:
* When the .mycroft/skills/<SkillName> folder didn't already exist
* When network timeouts and such occcurred

I also slipped in a couple trivial code cleanups for an unused variable
and a log message.
2019-02-14 15:41:27 -06:00
Åke 0ae66c3f93 Bugfix/speech stop (#1961)
* Refactor mimic2 to use the shared tts architecture

* Make sure the queue is cleared

- Add a convenience method grouping clear_queue and clear_visemes
- The start time is now set before the lock to allow multiple speech requests queued before the stop signal to also be cancelled
- Make sure the any pending TTS generation is cleared from the queue by calling tts.clear() when breaking from the chunking loop.
2019-01-31 01:30:53 -06:00
Åke 267c7bf571 Single viseme message (#1973)
* Add new api command to send visemes as single list.  This allows more efficient use of the messagebus and gives implementors flexibility in how they handle the visualization.

* Switch mark1 to use viseme_list
2019-01-31 00:37:55 -06:00
Åke Forslund 38701a9790 Remove inheritance from object
Inheriting from object isn't necessary in python3.
2019-01-11 09:24:21 +01:00
Åke c92f92de4f Bugfix/mimic2 negative numbers (#1927)
* Fix mimic2 negative numbers

Make the regex extracting numbers also match negative numbers when preparsing phrases sent to the mimic2 service

* Update pronounce_number to use "minus" for negatives

After discussion in the chat it was suggested to use "minus" for negatives as default.

When scientific notation is used the term "negative " is still used.
2019-01-02 16:36:04 -06:00
mpolidori a43a748f97 Change regex string to raw string (#1845) 2018-10-10 12:23:59 -05:00
Michael Nguyen 9228367678 catch more exceptions 2018-10-08 17:14:43 -05:00
Michael Nguyen b22e9d975d fall back tts function for connection errors 2018-10-08 16:54:22 -05:00
Steve Penrod a0eee8862b Use the phonetic_spellings.txt in Mimic2
The "phonetic_spellings.txt" mechanism converts odd words to strings that
represent what they should sound like when spoken.  For example, "mycroftai"
to "Mycroft A.I.".  This provides an easy mechanism to provide hints to
lots of Text to Speech engines.

This adds it to Mimic2, along with a spelling of "corgi".
2018-09-26 23:54:23 -05:00
Michael Nguyen 1d472df803 fix commenting 2018-09-12 16:00:53 -05:00
Michael Nguyen 09a785364f remove unecessary log 2018-09-12 13:50:32 -05:00
Michael Nguyen 402b02b7fa added doc string and removed danerous default arg 2018-09-12 13:49:16 -05:00
Michael Nguyen 7b9ed611aa changes to mycroft core to do longer sequence generations 2018-09-06 15:05:00 -05:00
Åke 85ae69597b Separate enclosure api from enclosure client (#1760)
This is a step towards abstracting the idea of an Enclosure which ties Mycroft to the hardware that is running Mycroft.

- Move the enclosure API to mycroft.enclosure.api (previously was mycroft.client.enclosure.api)
- Move display_manager out of enclosure client to mycroft.enclosure.display_manager
- Merge EnclosureWeather into EnclosureMouth
- Wrap display manager in a class
2018-08-27 13:44:12 -05:00
Åke 64476eb143 Replace emitter/ws with bus (#1757)
Makes the code a bit more understandable
2018-08-21 20:50:50 -05:00
Michael Nguyen a5a119507e restrict str.replace from doing a global string replacement 2018-08-15 19:27:59 -05:00
Åke 3099d004dd Fix issue writing phonemes to disk (#1720)
Change Mimic.get_tts() to return phonemes as string instead of bytes
2018-08-15 03:59:11 -05:00
Michael Nguyen 14e862bfaa Fix isSpeaking Signal for Mimic2 TTS (#1724)
Allows skills to determine while TTS is still occurring
2018-08-14 23:10:23 -05:00
Michael Nguyen 408f0ef4bc function to normalized all numbers to text equivalent (#1737)
Numbers are now normalized to the text equivalent. This is to solve problems where mimic2 returns a speed up text generation when saying number values.
2018-08-14 22:01:08 -05:00