mirror of
https://github.com/kokarare1212/librespot-python.git
synced 2026-04-25 16:45:50 +03:00
[GH-ISSUE #81] "byte == -1" no longer works for detecting end of songs #5
Labels
No labels
bug
dependencies
duplicate
enhancement
invalid
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot-python-kokarare1212#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Oct 17, 2021).
Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/81
With the current version of librespot-python it no longer returns "-1" when the song ends, the best I could figure out was waiting until the byte returned is empty/null but it is by no means perfect so I was wondering if you could look into this issue please.
@kokarare1212 commented on GitHub (Oct 17, 2021):
Thank you for your inquiry.
The method
stream.input_stream.stream().read()has been changed to return all music streams if no argument is specified.Therefore, no loop is needed.
I apologize for the inconvenience.
@ghost commented on GitHub (Oct 17, 2021):
Thanks for the quick reply, with the new method how can I detect the end of the song then?
@kokarare1212 commented on GitHub (Oct 17, 2021):
If you write the following, the variable "data" will be filled with music data
@ghost commented on GitHub (Oct 18, 2021):
Yeah but how do I know when the song has finished playing?
@kokarare1212 commented on GitHub (Oct 18, 2021):
The above code will pass the data up to the end of the song.
The data will be thread-blocked while it is being retrieved internally, so when the function finishes executing, the data will have been stored until the end.
@ghost commented on GitHub (Oct 18, 2021):
I appreaciate the explanation but i dont understanr it completely. Is there a way to make it detect the end of the track like the old way does?
@kokarare1212 commented on GitHub (Oct 18, 2021):
The following older branches are not actively maintained, but can be used if needed.
https://github.com/kokarare1212/librespot-python/tree/main
@ghost commented on GitHub (Oct 18, 2021):
Many thanks!