Musik ersetzt Audiostream wenn neues Genre gefragt wird
This commit is contained in:
Binary file not shown.
7
main.py
7
main.py
@@ -19,8 +19,6 @@ music_should_resume = False
|
||||
music_was_playing = False
|
||||
|
||||
|
||||
#test
|
||||
|
||||
# =========================
|
||||
# KONFIGURATION
|
||||
# =========================
|
||||
@@ -318,14 +316,15 @@ def status_wecker_skill(slots):
|
||||
return f"Es ist kein Wecker gestellt"
|
||||
|
||||
def play_music_skill(slots):
|
||||
|
||||
genre = slots["genre"]
|
||||
|
||||
if not music_player.load_genre(genre):
|
||||
return f"Keine Musik im Genre {genre} gefunden"
|
||||
|
||||
speak(f"{genre} Musik wird abgespielt")
|
||||
|
||||
music_player.play()
|
||||
return f"{genre} Musik wird abgespielt"
|
||||
return ""
|
||||
|
||||
def pause_music_skill(slots):
|
||||
music_player.pause()
|
||||
|
||||
@@ -26,6 +26,12 @@ class MusicPlayer:
|
||||
if not os.path.isdir(folder):
|
||||
return False
|
||||
|
||||
if self.playing or self.paused:
|
||||
self.player.stop()
|
||||
self.playing = False
|
||||
self.paused = False
|
||||
|
||||
|
||||
self.files = [
|
||||
os.path.join(folder, f)
|
||||
for f in os.listdir(folder)
|
||||
|
||||
Reference in New Issue
Block a user