Spaces:
Sleeping
Sleeping
add msg
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ def play_audio_from_url(url):
|
|
57 |
pygame.time.Clock().tick(10)
|
58 |
|
59 |
@tool
|
60 |
-
def play_preview_deezer(track: str, artist:str) ->
|
61 |
"""Play a preview of a track from Deezer.
|
62 |
Args:
|
63 |
track: The track to play.
|
@@ -94,6 +94,7 @@ def play_preview_deezer(track: str, artist:str) -> None:
|
|
94 |
# Play the track
|
95 |
print("Playing preview: ", first_track['preview'])
|
96 |
set_audio_url(first_track['preview'])
|
|
|
97 |
else:
|
98 |
raise ValueError("No tracks found.")
|
99 |
else:
|
|
|
57 |
pygame.time.Clock().tick(10)
|
58 |
|
59 |
@tool
|
60 |
+
def play_preview_deezer(track: str, artist:str) -> str:
|
61 |
"""Play a preview of a track from Deezer.
|
62 |
Args:
|
63 |
track: The track to play.
|
|
|
94 |
# Play the track
|
95 |
print("Playing preview: ", first_track['preview'])
|
96 |
set_audio_url(first_track['preview'])
|
97 |
+
return f'{first_track['title']} by {first_track['artist']['name']} is playing.'
|
98 |
else:
|
99 |
raise ValueError("No tracks found.")
|
100 |
else:
|