Chromecast can be manually added with a backend entry with type set to "chromecast" or the service can autodetect all chromecast and register them with their names by setting the Audio configuration parameter autodetect-chromecast set to true.
Currently this implementation is very basic and is using the default media controller. This limits the usable uri's to http(s), adding support for local files and hopefully more services will be added later.
The user can now specify which backend to use to play media. default the keywords are the name of the backend (vlc, mpg123, mopidy) but can be set with the config.
Example:
audio.mopidy.name = "livingroom"
A possible user interaction might be
- "Hey mycroft, play the news in the livingroom"
The detection is very basic and not very elegant but works as a proof of concept.
Three backends have been added, mopidy, vlc and mpg123. Depending on uri type an apporpriate service is selected when media playback is requested. (for example mopidy service can handle spotify://... and local://...)
A playback Control skill can pause, resume, stop change track, etc any started media. So for example if the NPR news skill used this after starting playing the news the user can say "Hey Mycroft, pause" and the playback will pause. The playback control also handles stuff like lowering the volume of the playback if mycroft is asked another question.
Currently the different backend runs under the playbeck control, this was made most for convenience and the services should be moved in the future.
Usage:
The user needs to import the audioservice interface
`from mycroft.skills.audioservice import AudioService`
and initialize an instance in the skill `initialize` method
`self.audio_service = AudioService(self.emitter)`
Then playing an uri is as simple as
`self.audio_service.play(uri)`
TODO:
* Configuration (Alias for the different backends, service specific config, active services, etc.)
* Manual selection of backend (This is prepared in the audioservice interface biut not implemented)
* More feature complete audio service interface (playback control, get trackname etc)
* Separate audio services from the playback control
* Probably lots more
==== Fixed Issues ====
#926
==== Tech Notes ====
All build_host_setup_* scripts updated with versions of the
libjpeg62-turbo package
==== Documentation Notes ====
NONE
==== Localization Notes ====
NONE
==== Environment Notes ====
libjpeg-turbo62-dev will be needed as a requirement for the mycroft-core
package.
==== Protocol Notes ====
NONE