Commit Graph

80 Commits (65fcfcfcff67248829230823f6af91c5b14ce413)

Author SHA1 Message Date
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
Nolan Darilek adfd9154db Better logging around why writing .PHO file fails. 2018-08-06 20:28:52 +00:00
Michael Nguyen fe00294b4c Feature/mimic2 visemse (#1708)
* added ability to create visemes
* clean visemes code, added url to mycroft.conf
2018-08-02 15:08:10 -05:00
Michael Nguyen 1ab9ae3889 Add Mimic 2 TTS
* added asynchronous request to mimic2 backend to break up audio into chunks

 * add chracter threshold

 * refactored split_by_punctuation

 * add punctuation function to sentence chunks

 * fix spelling

 * some more spelling

 * added mimic2 in mycroftconf

 * removed unused imports
2018-07-18 13:10:07 -05:00
Steve Penrod 17aab53fae Enhance the behavior of the Mark 1 button (#1668)
The Mark 1 button press can now be "consumed" when a skill handles
the Stop command.  When this happens, the button press will not
trigger listening mode.  An additional press would be needed to
trigger listening.

This introduces the "mycroft.stop.handled" messagebus message.  It
carries a data field called "by" which identifies who handled it.
Currently the values are "TTS" for when speaking ends or the name
of a skill which implements Stop and returns True from the call.

Also fixed a potential bug when the flag to clear queued visemes
was left set after a button press.
2018-07-05 20:56:54 +02:00
JarbasAI db4740d407 Add Responsive voice tts (#1565)
Adds responsive voice as an optional TTS service.

See https://responsivevoice.org/text-to-speech-sdk/text-to-speech-widget/
2018-07-04 13:21:34 +02:00
Åke Forslund 650e051b0b Handle words with capitals 2018-06-06 17:16:41 +02:00
Matthew D. Scholefield 509162de50 Support tilda in data_dir 2018-05-23 15:03:01 -05:00
Matthew D. Scholefield b0b88bbd62 Remove all references to /opt/mycroft 2018-05-23 08:22:14 +02:00
Åke Forslund 8c5911ecf0 Fix code standard issues
- dev_setup.sh - replace `` with $()
- mycroft/skills/core.py remove remove redundant imports
- mycroft/tts/__init__.py remove remove redundant imports
2018-05-03 12:32:21 +02:00
Åke Forslund a2993e4ba6 Remove backwards compatibility with python 2.7 2018-04-27 08:51:47 -05:00
Åke Forslund 29a2e14a2f Fix google tts now playing audio
The file extention of the audio was not set properly in the google_tts causing it to fail to playback the synthezised audio
2018-04-26 15:08:35 +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
jarbasai 29e18cba8f fix bing gender 2018-01-09 19:16:39 +00:00
jarbasai 5c14fb3b62 bing tts 2018-01-09 19:16:26 +00:00
jarbasai f1c64471c6 bing tts 2018-01-09 19:15:28 +00:00
Åke Forslund 936bd54180 Add a function to build the standard timing report 2018-01-08 18:01:03 -06:00
Åke Forslund c1d3342fc6 Add playback timing reports in playback thread
This covers the default case with mimic and in the future more as they
are moved over to using the playback thread
2018-01-08 18:01:03 -06:00
Åke c3d0c1bcb9
Merge pull request #1261 from JarbasAl/ibm_tts
Add IBM Watson tts
2018-01-07 16:58:45 +01:00
Åke Forslund aed83da43f Add basic validation 2018-01-03 23:01:19 +01:00
Åke Forslund fd6ea82cab Fix Authentication for tts_ibm 2018-01-03 23:00:50 +01:00
Åke 02e9ad7bb0
Merge pull request #1287 from MycroftAI/feature/tts-phonetic-spelling
Add phonetic spelling option to TTS engines.

Allows to override words with better sounding alternatives listed in res/text/phonetic_spellings.txt
2018-01-03 14:53:06 +01:00
Åke Forslund 41c2f43022 Handle unknown architectures better 2017-12-20 15:46:33 -06:00
Åke 742558046d Python 2/3 compatibility (#1259)
Add Python 2/3 compatibility

====  Tech Notes ====
This allows the main bus, skills and cli to be run in both python 2.7 and
3.5+.

Mainly trivial changes
- syntax for exceptions
- logic for importing correct Queue module
- .iteritems -> future.utils.iteritems when accessing dicts key value
pairs

* Allow audio service to be run in python 3
* Make speech client work with python 3
* Importing of Queue version dependent
* Exception syntax corrected
* Creating sound buffer is version dependant
- Adapt context use range from builtins
- Use compatible next() instead of .next() when walking the skill
directory

* Make CLI Python 3 Compatible
- Use compatible BytesIO instead of StringsIO
- Open files as text instead of binary
- Make sure integer divisions are used

* Make messagebus send compatible
* Fix failing travis

Re-add future 0.16.0

* Make string checks compatible
* basestring doesn't exist in python 3 so it's imported from the "past"
* Fix latest compatibility issues in speech client
- handle urllib
- handle encoding before calling md5

* Make Api.build_json() python 2/3 compatible
2017-12-18 17:24:21 -06:00
Matthew D. Scholefield 1fecf64fc7 Add phonetic spelling option to TTS engines 2017-12-06 21:43:53 -06:00
penrods 706e516cb4 Fix the timing of isSpeaking signal
The isSpeaking signal would only be generated when the actual audio playback
started, but this could be several seconds for TTS engines like Mimic which
take some time to generate the audio file for playback.  This changes the
creation of the "isSpeaking" signal to the start of the execute() method,
which should queue up audio and leave the signal set until the queue has
eventually been cleared.
2017-12-06 02:31:10 -06:00
jarbasai ed660183f0 ibm watson tts 2017-11-26 21:00:17 +00:00
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