Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Sep 12, 2024
1 parent eb9672b commit 00fedf9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ovos_audio/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import time
from threading import Lock
from typing import List, Tuple, Union
from typing import List, Tuple, Union, Optional

from ovos_audio.utils import require_native_source
from ovos_bus_client.message import Message
Expand Down Expand Up @@ -386,7 +386,7 @@ def restore_volume(msg=message):
else:
LOG.debug("No audio service to restore volume of")

def _extract(self, tracks: List[Union[str, Tuple[str, str]]]) -> List[str]:
def _extract(self, tracks: Union[List[str], List[Tuple[str, str]]]) -> List[str]:
"""convert uris into real streams that can be played, eg. handle youtube urls"""
xtracted = []
xtract = load_stream_extractors() # @lru_cache, its a lazy loaded singleton
Expand All @@ -397,7 +397,8 @@ def _extract(self, tracks: List[Union[str, Tuple[str, str]]]) -> List[str]:
xtracted.append(xtract.extract_stream(t[0], video=False)["uri"])
return xtracted

def play(self, tracks, prefered_service, repeat=False):
def play(self, tracks: Union[List[str], List[Tuple[str, str]]],
prefered_service: Optional[str], repeat: bool =False):
"""
play starts playing the audio on the prefered service if it
supports the uri. If not the next best backend is found.
Expand Down

0 comments on commit 00fedf9

Please sign in to comment.