Skip to content

Commit

Permalink
Update audio.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Jun 27, 2023
1 parent 40e818c commit 8aa0f07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ovos_audio/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AudioService:
to be played.
"""

def __init__(self, bus, autoload=True, disable_ocp=False):
def __init__(self, bus, autoload=True, disable_ocp=False, validate_source=True):
"""
Args:
bus: Mycroft messagebus
Expand All @@ -49,6 +49,7 @@ def __init__(self, bus, autoload=True, disable_ocp=False):
self.play_start_time = 0
self.volume_is_low = False
self.disable_ocp = disable_ocp
self.validate_source = validate_source

self._loaded = MonotonicEvent()
if autoload:
Expand Down Expand Up @@ -349,9 +350,8 @@ def play(self, tracks, prefered_service, repeat=False):
self.current = selected_service
self.play_start_time = time.monotonic()

@staticmethod
def _is_message_for_service(message):
if not message:
def _is_message_for_service(self, message):
if not message or not self.validate_source:
return True
destination = message.context.get("destination")
if destination:
Expand Down

0 comments on commit 8aa0f07

Please sign in to comment.