Commit Graph

50 Commits (1faedf60529b78b0fe4c9961ab3ffd12100748e9)

Author SHA1 Message Date
Åke Forslund 741cc1c8db Fallback to default STT if loading fails
If a STT backend fails to load log the exception and fallback to the
MycroftSTT.
2019-10-26 09:30:07 +02:00
Kirill Kirilenko 1faf7b2210 Add Yandex STT support 2019-09-30 17:38:36 +02:00
Åke Forslund f727c00430 Move pairing check to the relevant stt backends
The pairing trigger should only be triggered by the 401 status for the
Mycroft hosted STT backends. Doing it for other STT's is only confusing.

This creates the decorator 'requires_pairing' that can be applied to the STT modules where it's relevant.

This adds the decorator to the MycroftSTT and the MycroftDeepSpeechSTT
2019-08-02 18:16:29 +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
David Wagner 4aab06d94a Docstrings 2019-06-13 09:52:31 -05:00
David Wagner d962240405 PEP8 2019-06-13 09:13:41 -05:00
David Wagner e9f68fea55 Only import google-cloud-speech if GoogleCloudStreamingSTT class is used. 2019-06-13 08:51:16 -05:00
David Wagner 5f18b12617 Add back self.text 2019-06-13 07:17:08 -05:00
David Wagner 89a9ea16e2 Whitespace! 2019-06-11 17:41:06 -05:00
David Wagner bd2c1d802d PEP8 and remove fallback_stt 2019-06-11 17:35:50 -05:00
David Wagner 85931f43fc Google imports 2019-06-11 17:01:02 -05:00
David Wagner ab3c75f1f8 Google streaming 2019-06-11 17:00:47 -05:00
David Wagner 20d58e5724 DeepSpeech streaming 2019-06-11 17:00:16 -05:00
David Wagner c9dc14d528 StreamThread and StreamingSTT abstract classes 2019-06-11 16:59:45 -05:00
David Wagner 16248ee313 Initial Google Streaming STT implementation off of PR 2149 with dev logs scattered about 2019-06-10 17:32:38 -05:00
Joshua Watt 7bbfe0c9fb Add Streaming DeepSpeech Server STT Backend
Implements a STT backend for a DeepSpeech server that accepts streaming
requests. For example: https://github.com/JPEWdev/deep-dregs
2019-06-09 22:28:09 -05:00
Joshua Watt 601eeb6bdc Implement streaming STT framework
The initial framework for live streaming Speech to Text. STT derived
classes now can report that they support live streaming via their
"can_stream" property. If True, the following member functions will be
called on the object:

stream_start() - Called when a stream is starting. Should setup any
persistent state required to process speech to text.

stream_data(chunk) - Called when a chunk of audio data has been
captured.

stream_stop() - Called when a stream should be stopped. Should tear down
any state setup with stream_start(). Note that this may be called at
anytime (even if stream_start() has not been called).

Note that the execute() API is still used to get the text utterance from
the class.

A typical sequence of calls would be:

 stream_start()
 stream_data(...)
 stream_data(...)
 stream_data(...)
 stream_data(...)
 ...
 execute(...)
 stream_stop()
2019-06-09 22:28:09 -05:00
Åke Forslund 1400af2b16 Fix pycodestyle errors 2019-05-15 13:46:43 +02: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 612f734154 Add module specific lang option to GoogleCloudStt (#1842) 2018-10-10 03:05:05 -05:00
JarbasAI d69e73ced9 govivace_stt (#1654)
* Add support for Govivace STT (https://www.govivace.com/)
2018-06-27 16:09:56 +02:00
Michael Nguyen 1683e54389 remove exception 2018-03-23 16:58:33 -05:00
Michael Nguyen 66991f8d25 added exception 2018-03-23 11:46:21 -05:00
Michael Nguyen 7692389317 remove logs 2018-03-22 13:33:10 -05:00
Michael Nguyen 6dbb2182ff added mycroft deepspeech factory in stt 2018-03-22 13:28:24 -05:00
Åke d9c288129c Add support for deepspeech_server (#1370)
* Add support for deepspeech_server

deepspeech_server is a server running deepspeech (obviously). It's quite
easy to install and run (package available in pip and then a config file
pointing to the model)

This pr adds the DeepSpeechServerTTS class, a STT interface allowing
mycroft to use one of these servers.

config needed:

  "stt": {
    "module": "deepspeech_server",
    "deepspeech_server": {
      "uri": "http://IP-ADDRESS:PORT/stt"
    }
  }

* Add deepspeech_server example to mycroft.conf
2018-01-25 14:02:42 -06:00
Jarbas 905e5397ed bing + houndify stt (#1229)
Add bing and Houndify stt backends
2018-01-09 13:41:26 +01:00
Andrew Hayworth 6325c7ae7b Add replacment for Google TTS via Google Cloud Speech API
As noted on the Chromium Dev How-to [1] and on the
SpeechRecognition library docs [2], the Google TTS API
is really not the right API to call. While it's simple,
and allows you to authenticate via a simple token, it is
also limited to a max of *50* requests per day.

That's not a lot. I don't think many people will find that
useful, outside of quick testing (if they can even get an
API key - I couldn't figure out how to generate one that
worked correctly).

This commit introduces a new STT backend, google_cloud, so that
the Google STT backend can be deprecated eventually. To do so, we
needed to:
- Install the Google API Client Library
- Create a new STT class which knows how to turn a provided Google
  JSON credentials file into a string (the SpeechRecognition library
  expects you to pass in the JSON string, not a file path, nor an object).

Any person wishing to use this will need to:
- Enable the Cloud Speech API on the Google Cloud Platform console
- Create a new Service Account Key, and download the credentials to
  a secure location
- Configure that location in mycroft.conf, like so:

  "stt": {
    "google_cloud": {
      "credential" {
        "json": { contents of downloaded credentials }
      }
    }
  }

It's worth noting that the Cloud Speech API has a free quota of
60 minutes per month, which would probably stretch further than 50
individual requests. So for hobbyists, it should be nothing but
a net benefit.

[1] http://www.chromium.org/developers/how-tos/api-keys
[2] https://github.com/Uberi/speech_recognition/blob/master/reference/library-reference.rst#recognizer_instancerecognize_googleaudio_data-key--none-language--en-us-show_all--false
2017-11-15 22:10:00 -06:00
Åke Forslund 3e878bd59f Replace ConfigurationManger with Configuration 2017-10-26 19:02:32 -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 d750935fe3 Allow any bitrate of audio to the MycroftSTT
====  Tech Notes ====
Setting the convert_rate enforces the output bitrate of the FLAC audio.

This requires update of speechrecognition (3.7.1) and PyAudio (0.2.11)

==== Environment Notes ====
PyAudio => 0.2.11
speechrecognition => 3.7.1
2017-09-13 14:31:36 -05:00
Teagan Glenn e0a88667ee Configs for kaldi 2017-07-05 10:02:35 -06:00
Teagan Glenn 5d1cb4dbdf Use config var 2017-07-05 09:10:15 -06:00
Teagan Glenn a64862cf41 Fixes based on PR comments 2017-07-05 09:06:08 -06:00
Teagan Glenn f795ea0237 Kaldi STT 2017-07-04 15:46:08 -06:00
Augusto Monteiro 1518444f6d Merge pull request #611 from SoloVeniaASaludar/bugfix/issue-610
i18n: language codes are not always two word
2017-05-19 22:57:46 -03:00
Åke Forslund d6e816f747 Fix GoogleSTT
Fix provided by remidechazelles, many thanks.
2017-05-18 16:53:10 -03:00
SoloVeniaASaludar f0b264d6c0 issue-610 2017-03-31 16:40:06 +02:00
penrods cfa79e03a2 Fixes issue #539
The utterance is now placed on the bus along with its language code.  If not specified, it uses "en-us".

Added a new mycroft.util.parse module.  It contains the normalize() function.  Normalization currently does two things:
  * Expands contractions ("they're" -> "they are", etc)
  * Optionally removes articles ("a", "an", "the").  Removing is the default.
  * Textual numbers become digits, up to 20.  E.g. "What is the weather in four days" becomes "What is weather in 4 days".

NOTE:  This is potentially a breaking change!  Remove "the", "a" and "an" from your .voc files!

Skill changes:
  * I cleaned up the .voc files for the default Skills.
  * Split the date_time keyword into an extra entity.  Now a "QueryKeyword.voc" exists, with "what|tell" instead of combing that into "what is time" in the TimeKeyword.voc.
  * Volume skill now accepts 1-11, e.g. "turn volume to 11"
2017-03-14 13:43:45 -05:00
Jonathan D'Orleans 04359f000f #484 - Fixing STT config initialization
- Ensuring config is set to the specified module
- Initializing credential from the selected module configuration
2017-02-01 23:40:13 -03:00
Jonathan D'Orleans f781e1db02 Issues 350 - Ensuring Listener has sampleRate and channels settings 2016-12-17 10:27:01 -05:00
Matheus Lima 1a1599147f Issues 383 - Adding limit parameter to Google STT Integration 2016-12-17 10:27:01 -05:00
Jonathan D'Orleans bf9d29ab67 Issues 356 - Adding STT multi credentials support and fixing proxy flag type 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans 98aa95434b Issues 356 - Sending flac data to mycroft stt instead of frames 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans 9e0c614a47 Issues 356 - Ensuring str type for STT credentials 2016-12-17 10:16:29 -05:00
Jonathan D'Orleans bd1175c1cb Issues 356 - Initializing language value for STT 2016-12-17 10:15:24 -05:00
Jonathan D'Orleans 8d2d77d661 Issues 356 - Fixing STT query language parameter 2016-12-17 10:15:24 -05:00
Jonathan D'Orleans c71c054258 Issues 351 - Creating STT module and classes 2016-12-17 10:15:24 -05:00