Implement TTS module that works with Mozilla-TTS server.
==== Environment Notes ====
Requires a Mozilla-TTS server running preferably in your local network.
The hash sing makes it difficult to deal with the json file. Even using tools like [jsmin](https://github.com/tikitu/jsmin/) does not help since hashes are not supported. To enhance interoperability and consistency, they can be removed (also because only two lines use them).
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.
Major refactoring of the skills startup sequence
- Restructure to a less nested structure
- Remove usage of globals by wrapping a lot of state variables into a class this allows for things like caching a negative pairing status throughout the startup process
- Add module docstring
- Add comment in the init class method about setting up the log level
- Add mycroft.util.log to the readthedocs documentation
- Add comment in the config about the log_level
* Restored ability to store wakewords locally
The code that handles the local save of wake words configuration -
"record_wake_words" - was removed some time ago. This restores that
capability.
Add the following to mycroft.conf
{
"listener": {
"record_wake_words": true
}
}
Then restart Mycroft. It should begin saving .wav files under the
/tmp/mycroft_wake_words directory.
The filename, will be filename structure is:
<accountId>_<engine>_<model>_<name>_<sessionId>_<time>.wav
* Add documentation for 'record_wake_words' and improve the doc for
'save_utterances'.
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.
* Deprecate self.config in skills
Skills should contain their own settings, the self.config concept is being
deprecated.
Also removed the defaults set for several old MycroftAI skills. The 19.02
version of these Skills initializes the default values using:
```python
self.settings["key"] = default
```
* Update padatious config to work with the config property.
- Move "save_utterenaces" comments to correct block
- Correct information, records utterance not wakeword
- replace "record_utterances" with the new "save_utterances"
Normally Mycroft will use the default PortAudio input device as the
microphone input for the user. However in some cases there is reason
to specify a different input.
The "device_index" under the "listener" section in mycroft.conf has
always allowed a user to select the microphone explicitly. But on
some systems the indices can change from reboot to reboot. So this
adds the "device_name" setting. If it exists (and the "device_index"
has not been specified explicitly), a regex match will be run against
the PortAudio device names.
When "device_name" is used, the voice.log will contain a listing of
the devices as they are tested. This can be used to debug if a
name isn't matching as expected.
EXAMPLES:
/etc/mycroft/mycroft.conf
```
{
"listener": {
"device_name": "aawsrc"
}
}
```
Would find a match against "aawsrc" or "aawsrcplug". To force a specific
match, you can use a regex such as "aawsrc$".
/etc/mycroft/mycroft.conf
```
{
"listener": {
"device_index": 2
}
}
```
The PortAudio device index specified will be used.
Names and indexes for PortAudio are difficult to guess. The simplest way to
view them is either enter a value for "device_name" and look at the names
which appear in the log when starting Mycroft, or to run a simple program
such as:
```python
import pyaudio
pa = pyaudio.PyAudio()
for i in range(pa.get_device_count()):
dev = pa.get_device_info_by_index(i)
print((i, dev['name'], dev['maxInputChannels']))
```
The ability to "barge-in" has been lacking from Mycroft Core. The Mark 1
microphone was unable to support this due to physical limitations, but the
Mark II and other implementations with more advanced mic tech which can
hear over themselves are able to continuously listen.
To enable this while retaining backwards compatibility with simpler mic.py
systems, there are now two mycroft.conf values:
{
"listener": {
"mute_during_output" : true,
"duck_while_listening" : 0.3
}
}
The above values are defaults, and implementers will likely override them
using the /etc/mycroft/mycroft.conf file when appropriate.
The duck_while_listening setting is currently handled in Mycroft's
skill-volume. The mute_during_output is handled within mycroft-core itself.
Enclosures
* Create a mechanism to instantiate unique Enclosure classes, depending on the platform found in the SYSTEM mycroft.conf
* Implement a generic Enclosure, which support the new GUI protocol
* Implement a Mark 1 Enclosure (expects the serial connection to an Arduino)
* Implement the start of a Mark II enclosure
* Implement a generic enclosure (no screen)
* Implement the GUI announcement and protocol basics
MycroftSkill
* Implement the basis of the GUI-controlling interfaces. Namely:
- MycroftSkill.show_text()
- MycroftSkill.show_image()
- MycroftSkill.show_html()
- MycroftSkill.show_page()
- MycroftSkill.gui to set values for page displays.
Configuration
* Add "gui_websocket" to the mycroft.config.py