Public Member Functions | |
| def | __init__ (self, bus) |
| def | load_services_callback (self) |
| def | play (self, tracks, prefered_service, repeat=False) |
| def | pulse_lower_volume (self) |
| def | pulse_mute (self) |
| def | pulse_restore_volume (self) |
| def | pulse_unmute (self) |
| def | setup_pulseaudio_handlers (self, pulse_choice=None) |
| def | shutdown (self) |
| def | track_start (self, track) |
Public Attributes | |
| bus | |
| config | |
| current | |
| default | |
| muted_sinks | |
| play_start_time | |
| pulse | |
| pulse_quiet | |
| pulse_restore | |
| service | |
| service_lock | |
| volume_is_low | |
Private Member Functions | |
| def | _list_backends (self, message) |
| def | _lower_volume (self, message=None) |
| def | _next (self, message=None) |
| def | _pause (self, message=None) |
| def | _play (self, message) |
| def | _prev (self, message=None) |
| def | _queue (self, message) |
| def | _restore_volume (self, message) |
| def | _resume (self, message=None) |
| def | _seek_backward (self, message) |
| def | _seek_forward (self, message) |
| def | _stop (self, message=None) |
| def | _track_info (self, message) |
Audio Service class.
Handles playback of audio and selecting proper backend for the uri
to be played.
Definition at line 130 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.__init__ | ( | self, | |
| bus | |||
| ) |
Args: bus: Mycroft messagebus
Definition at line 136 of file audio/audioservice.py.
|
private |
Return a dict of available backends.
Definition at line 434 of file audio/audioservice.py.
|
private |
Is triggered when mycroft starts to speak and reduces the volume.
Args:
message: message bus message, not used but required
Definition at line 274 of file audio/audioservice.py.
|
private |
Handler for mycroft.audio.service.next. Skips current track and
starts playing the next.
Args:
message: message bus message, not used but required
Definition at line 234 of file audio/audioservice.py.
|
private |
Handler for mycroft.audio.service.pause. Pauses the current audio
service.
Args:
message: message bus message, not used but required
Definition at line 213 of file audio/audioservice.py.
|
private |
Handler for mycroft.audio.service.play. Starts playback of a
tracklist. Also determines if the user requested a special
service.
Args:
message: message bus message, not used but required
Definition at line 398 of file audio/audioservice.py.
|
private |
Handler for mycroft.audio.service.prev. Starts playing the previous
track.
Args:
message: message bus message, not used but required
Definition at line 245 of file audio/audioservice.py.
|
private |
Definition at line 391 of file audio/audioservice.py.
|
private |
Is triggered when mycroft is done speaking and restores the volume
Args:
message: message bus message, not used but required
Definition at line 332 of file audio/audioservice.py.
|
private |
Handler for mycroft.audio.service.resume.
Args:
message: message bus message, not used but required
Definition at line 224 of file audio/audioservice.py.
|
private |
Handle message bus command to rewind X seconds
Args:
message: message bus message
Definition at line 457 of file audio/audioservice.py.
|
private |
Handle message bus command to skip X seconds
Args:
message: message bus message
Definition at line 446 of file audio/audioservice.py.
|
private |
Handler for mycroft.stop. Stops any playing service.
Args:
message: message bus message, not used but required
Definition at line 256 of file audio/audioservice.py.
|
private |
Returns track info on the message bus.
Args:
message: message bus message, not used but required
Definition at line 420 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.load_services_callback | ( | self | ) |
Main callback function for loading services. Sets up the globals
service and default and registers the event handlers for the
subsystem.
Definition at line 159 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.play | ( | self, | |
| tracks, | |||
| prefered_service, | |||
repeat = False |
|||
| ) |
play starts playing the audio on the prefered service if it
supports the uri. If not the next best backend is found.
Args:
tracks: list of tracks to play.
repeat: should the playlist repeat
prefered_service: indecates the service the user prefer to play
the tracks.
Definition at line 348 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.pulse_lower_volume | ( | self | ) |
Lower volume of all pulse audio input sinks except the one named
'mycroft-voice'.
Definition at line 310 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.pulse_mute | ( | self | ) |
Mute all pulse audio input sinks except for the one named
'mycroft-voice'.
Definition at line 291 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.pulse_restore_volume | ( | self | ) |
Restore volume of all pulse audio input sinks except the one named
'mycroft-voice'.
Definition at line 321 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.pulse_unmute | ( | self | ) |
Unmute all pulse audio input sinks.
Definition at line 301 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.setup_pulseaudio_handlers | ( | self, | |
pulse_choice = None |
|||
| ) |
Select functions for handling lower volume/restore of
pulse audio input sinks.
Args:
pulse_choice: method selection, can be eithe 'mute' or 'lower'
Definition at line 468 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.shutdown | ( | self | ) |
Definition at line 485 of file audio/audioservice.py.
| def mycroft.audio.audioservice.AudioService.track_start | ( | self, | |
| track | |||
| ) |
Callback method called from the services to indicate start of
playback of a track.
Definition at line 205 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.bus |
Definition at line 141 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.config |
Definition at line 142 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.current |
Definition at line 147 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.default |
Definition at line 145 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.muted_sinks |
Definition at line 154 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.play_start_time |
Definition at line 148 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.pulse |
Definition at line 150 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.pulse_quiet |
Definition at line 151 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.pulse_restore |
Definition at line 152 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.service |
Definition at line 146 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.service_lock |
Definition at line 143 of file audio/audioservice.py.
| mycroft.audio.audioservice.AudioService.volume_is_low |
Definition at line 149 of file audio/audioservice.py.