Commit Graph

52 Commits (941e01ad34c3c1f6924a40092afbdab1b91afead)

Author SHA1 Message Date
penrods c1e1b935ee Improve mouth synchronization with speech
When the TTS engine provides visemes to the faceplate, the information
passed along consists of the mouth shape and the duration to display it.
When the system get backed-up for some reason (e.g. the CPU is briefly
overloaded), the code would attempt to catch up the animation but would
still send the 'expired' viseme across the serial port to the faceplate
with no wait-time.  This results in a fast-moving mouth to catch up,
which isn't very pleasing.

Now the viseme is passed along with an expiration date, so if the time
to display it has already passed then the viseme code gets thrown away
instead of being sent across the (relatively slow) serial port.  This
allows better catch-up.
2017-11-20 21:22:48 -06:00
Åke Forslund 0bf3d9a668 Clear cache after playback.
====  Tech Notes ====
Since the playback now is performed in a thread the curate_cache could
clean out generated speech before or in the middle of playing back the
queue.
2017-10-26 18:05:57 -05:00
Åke Forslund 3e878bd59f Replace ConfigurationManger with Configuration 2017-10-26 19:02:32 -04:00
Åke Forslund e5f2e3d5cd Download subscription voices in the background
====  Tech Notes ====
Subscription voices are downloaded in the background as soon as mimic_tts
module is started.
2017-10-26 18:42:19 -04:00
Åke Forslund 285b4b6c14 Use wget to download, so resume/retry can be used
====  Tech Notes ====
Since the voice is a quite large download stalling download is a real
possibility. Using wget allows for resume and retry of download in a
simple way.
2017-10-26 18:42:19 -04:00
Åke Forslund 46c1b575fd Add methods for downloading premium voice
====  Tech Notes ====
- Using download utility to download voice binary
- reverts to default voice if not premium
- uses default voice during download and switches over when done
2017-10-26 18:42:19 -04:00
penrods 8f2e5d9498 Change to Apache 2.0 license from GPLv3.0
This commit officially switches the mycroft-core repository from
GPLv3.0 licensing to Apache 2.0.  All dependencies on GPL'ed code
have been removed and we have contacted all previous contributors
with still-existing code in the repository to agree to this change.

Going forward, all contributors will sign a Contributor License
Agreement (CLA) by visiting https://mycroft.ai/cla, then they will
be included in the Mycroft Project's overall Contributor list,
found at: https://github.com/MycroftAI/contributors.  This cleanly
protects the project, the contributor and all who use the technology
to build upon.

Futher discussion can be found at this blog post:
https://mycroft.ai/blog/right-license/

This commit also removes all __author__="" from the code.  These
lines are painful to maintain and the etiquette surrounding their
maintainence is unclear.  Do you remove a name from the list if the
last line of code the wrote gets replaced?  Etc.  Now all
contributors are publicly acknowledged in the aforementioned repo,
and actual authorship is maintained by Github in a much more
effective and elegant way!

Finally, a few references to "Mycroft AI" were changed to the correct
legal entity name "Mycroft AI Inc."

==== Fixed Issues ====
#403 Update License.md and file headers to Apache 2.0
#400 Update LICENSE.md

====  Documentation Notes ====
Deprecated the ScheduledSkill and ScheduledCRUDSkill classes.
These capabilities have been superceded by the more flexible MycroftSkill
class methods schedule_event(), schedule_repeating_event(), update_event(),
and cancel_event().
2017-10-04 01:28:44 -05:00
Matthew D. Scholefield 5e392f34aa Optimize imports
Remove unused imports and group local vs external alphabetically
2017-09-18 16:07:50 -05:00
Matthew D. Scholefield cfdc405da5 Add new LOG class 2017-09-18 13:56:06 -05:00
Åke Forslund 65fa735a3a Fix isSpeaking
====  Tech Notes  ====
isSpeaking was lowered as soon a the tts had synthesized the audio and
not when the output finished. This commit moves the signal
raising/lowering to the tts instead of the 'mycroft.speak' handler.
2017-09-13 12:02:27 -05:00
Åke Forslund 5b4ae74cfb Make visime stream end together with audio
===Fixed issues ====
#958

====  Tech Notes ====
Adds method clear_visimes() to voice playback thread to stop visime stream
instead of having visime stream check for signals.

====  Documentation Notes ====
NONE - things like description of a new feature or notes on behavior
changes

==== Localization Notes ====
NONE - point out new strings, functions needing international versions,
     etc.

==== Environment Notes ====
NONE - new package requirements, new files being written to disk,
etc.

==== Protocol Notes ====
NONE - message types added or changed, new signals, etc.
2017-08-03 10:57:14 +02:00
Åke Forslund 6f3e1e0d55 Fix filename for cache lookup 2017-07-19 10:43:57 -05:00
Åke dd30d586e1 Check queue empty with self.queue.empty() instead of len() (#894)
* Check queue empty with self.queue.empty() instead of len()

* Add error logging of exceptions in tts thread.

* Limit the number of audio_output_start messages.

recognizer_loop:audio_output_start message will only be sent if the
queue has been empty since last loop.
2017-07-07 09:08:28 -05:00
Matthew D. Scholefield 63d90cef4f Only output audio end when all audio has been spoken 2017-07-06 20:18:59 -05:00
Matthew D. Scholefield 0a09e6b91e Move audio output start and end messages to TTS class
This prevents them from being outputted too early if playback is run on another thread
2017-07-06 20:18:59 -05:00
Åke Forslund f714a5a882 Stop current sentence immediately by terminating playback 2017-07-06 11:49:47 +02:00
Åke Forslund 7143e5ef93 Return True when button is pressed as well. 2017-07-06 11:48:40 +02:00
Åke Forslund 3be91fb84c Allow "Stop" to clear playback queue 2017-07-06 09:41:22 +02:00
Åke Forslund fb6fa54fd8 refactor Google tts to take advantage of playback thread 2017-07-06 09:39:28 +02:00
Åke Forslund d378c9d1a6 Refactor Mimic class to keep caching functions in base class 2017-07-06 09:39:28 +02:00
Åke Forslund 0de3f49a82 Add threading for mimic tts 2017-07-06 09:34:33 +02:00
penrods 582b77891e One more pass at onboarding, including a major bug fix:
* BUGFIX: The big bug was calling is_paired() during wake_word_in_audio().  When not paired, that call hit the server, taking about a second.  Since it happened multiple times a second, the audio buffers got backed up hugely.  This resulted in weird behavior later as the buffers get cleared out.
* Added mycroft.api.has_been_paired(), which just looks for the pairing key (it does not validate it is still active with the server, like is_paired())
* The enclosure now checks for internet connectivity and kicks off the wifisetup process, not the wifisetup client itself.
* During the "onboarding" process, the microphone is muted using the new "mycroft.mic.mute" message.  After pairing completes, the "mycroft.mic.unmute" is expected to be sent from the pairing skill.  Unmuting again after a re-pairing is harmless.
* mute_and_speak() is smart enough to not unmute itself when complete if muted before
* util.check_for_signal() now accepts -1 as the lifetime.  This means it never times out.
* util.stop_speaking() is more intelligent about shutting down the spoken text (including text that has been split at periods) and visemes
2017-06-13 05:35:06 -05:00
penrods ffc3f6ec60 Implementing changes to out-of-the-box experience, providing an "onboarding" process.
* Added a mycroft.api.is_paired() method
* Added mycroft.util.is_speaking and mycroft.util.wait_while_speaking() methods
* RESET now waits for the spoken notice to complete
* Stopped the "Checking for updates" and "Skills updated" prompts (commented out for now, probably will eliminate)
* Wifi setup filters out hidden ("x00") networks
* Visemes should keep up better if they get behind (will skip)
* Mimic is now searched for on the users path
* Onboarding process:
  - wifi setup starts automatically
  - User is walked through the process
  - wake word and button pressing are ignored
  - At end, a short tutorial is given
2017-06-07 11:45:06 -05:00
Åke Forslund 925cadc19e Add support for switching tts and settings
- If tts config hash has changed re-initialize tts
- Cache is cleared on mimic initialization
2017-05-20 21:43:53 +02:00
Åke Forslund f4c1f4d2e5 Convert unicode string to bytes before hashing
Ignore flag set for extra safety.
2017-04-09 23:50:26 -07:00
Steve Penrod 10ff5debd7 Adding missing import and improved error messages 2017-03-30 11:05:46 -07:00
penrods 0043e6c889 Implementing audio cache feature in issue #598
The TTS audio is now cached.  If the same TTS is requested again, the cached WAV and phoneme sequence is reused.

Major points:
* Created mycroft.util.get_cache_directory().  You can give this a domain, also.  The mycroft.conf can define where this directory resides, so enclosures can have this reside on a ramdisk, for instance.
* Created mycroft.util.curate_cache().  This retains a percentage of the disk size free.
2017-03-30 02:40:56 -05:00
Åke 2a9bc7bda2 gTTS version bump (#454)
* upgrading gTTS

	- using play_mp3 to play mp3 files

Conflicts:
	mycroft/tts/google_tts.py

* Update gTTS version

* default to 'us-en' if lang is omitted

* Fix multiple sentence speech.

Wait until audio has been played before exiting `GoogleTTS.execute()`
2017-01-20 15:21:03 -06:00
Jonathan D'Orleans 11d78a55b8 Issues 426 - TTS web socket is not initialized properly
- Initialize tts ws and enclosure at the main process

Note:
- This is a minimal change to fix the problem.
- The ultimate goal is to have a totally isolated TTS process which requires its own main and ws initialization to be developed soon.
2016-12-21 00:18:25 -05:00
Jonathan D'Orleans 99ff4e3ce8 Issues 351 - Tartarus Integration
- Master rebase
- Renaming Websocket variable from client to ws
- Resetting enclosure when ws open
- Formatting pairing skill
2016-12-17 14:53:22 -05:00
Jonathan D'Orleans d8308470d2 Issues 356 - Checking button press signal during visime loop in mimic 2016-12-17 10:27:01 -05:00
Jonathan D'Orleans 6cf59a0b94 Issues 356 - Fixing visime delta duration 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans 86e712ec84 Issues 356 - Ensuring only code is sent as a message to visime enclosure 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans 184e400e9e Issues 356 - Moving Visime logic to Mimic TTS 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans 9e632a3c8a Issues 356 - Stopping processes during audio playback 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans 4c1ba4e337 Issues 356 - Rebasing with master 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans e76c1b7d21 Issues 356 - Refactoring TTS 2016-12-17 10:15:24 -05:00
Jonathan D'Orleans 89e9c2ff77 Issues 351 - Moving TTS Factory to tts __init__.py 2016-12-17 10:15:24 -05:00
Åke 218c53c127 Add support for duration_stretch config parameter (#334) 2016-09-22 09:18:27 -05:00
Steve c653c43910 Added viseme support for TTS, allowing enclosure to display visemes (#357)
* Added viseme support for TTS, allowing enclosure to display visemes as appropriate

* Enclosure versino bump
2016-09-05 16:27:09 -05:00
Arron Atchison 8bd2e1c4dc added regex to the speech handler instead 2016-08-15 10:09:14 -05:00
Arron Atchison 8a4145782c fixed regex to handle sentences better 2016-08-15 09:46:30 -05:00
Arron Atchison ac1b2324dd fixed pep8 error 2016-08-15 09:17:46 -05:00
Arron Atchison e761ac5a0b mimic_tts.py now splits Mimic imput into sentences, speaks them one a time. 2016-08-13 17:14:04 -05:00
Arron Atchison d55f785c55 mimic_tts.py now splits Mimic imput into sentences, speaks them one a time. 2016-08-13 17:08:23 -05:00
aatchison 74ac80b00a removed Alan's voice from mycroft core in preperation for a mimic release with the precompiled voice 2016-06-23 16:34:24 -05:00
aatchison 4068636005 Alan Pope voice runs by default, no idea what will happen when I package it 2016-06-17 13:20:11 -05:00
Jonathan D'Orleans c46bc43e72 Issues 96 - Moving configuration to init 2016-06-09 18:26:10 -04:00
Jonathan D'Orleans efff3dbda6 Issues 96 - Renaming get_config to get only 2016-06-09 18:25:37 -04:00
Ryan Sipes 8f2c451938 Fixed Missing License Headers on All Files.
GPL LIcense added to the top of each python file.
2016-05-26 11:16:13 -05:00