Commit Graph

13 Commits (162b37ffbd8152dd269f87710ac979a86ebbe410)

Author SHA1 Message Date
Åke Forslund 9c49f97421 Audio service is_playing property 2017-07-31 13:37:18 +02:00
Åke Forslund 6f37d3c8f8 Fix bug in track_info_method
* import Message to allow audio service to reply info
* Add default message to audio service class
2017-07-31 13:37:18 +02:00
Åke Forslund 839803c958 Rename messages.
As requested by Augusto Monteiro
2017-07-31 13:37:17 +02:00
Åke Forslund 86a557e1ac Docstrings! 2017-07-31 13:37:17 +02:00
Åke Forslund c81ad57ebf Populate AudioService class with more methods
Pause, resume, next and previous added to the interface.
The play method was updated to add 'file://' to uri's lacking uri type.
2017-07-31 13:37:17 +02:00
Åke Forslund 5c874677cc Add check for valid type of tracks 2017-07-31 13:37:17 +02:00
Åke Forslund 3001dd5a83 Move backend base class to audio/services 2017-07-31 13:37:17 +02:00
Åke Forslund 67502372bf fix pep8 issues 2017-07-31 13:37:17 +02:00
Åke Forslund ee5141ed6f Make all audio backend build on the base class
Abstract base class is now a bit more lenient
2017-07-31 13:37:16 +02:00
Åke Forslund 06a9eb7ee5 Initial update to follow changes in mycroft 2017-07-31 13:37:16 +02:00
Åke Forslund 26e63cdff3 Add abstract base class for audio backends 2017-07-31 13:37:16 +02:00
Åke Forslund 717c6fa49b Add track_info to audio service connection 2017-07-31 13:37:16 +02:00
Åke Forslund 89adf6e8ac Initial commit of audio service
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
2017-07-31 13:37:16 +02:00