-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration guide for major breaking changes due to audio backend rework #1175
Comments
Thanks for the report. Can you provide information to help us with your issue? Including the information specified in the bug report form, if you can share the output of the EDIT: I am unable to run your code on my machine, nor do I have an example of a Zip album. However from initial glance, it looks like you are overriding the I can tell this overridden class was based on a much older version. For example, the temporary file behavior was replaced in version 1.5.2, in 2020. I would probably start with getting your As far as seeking goes, I do see you are double seeking here: https://github.com/zipped-album/zap/blob/14c82fc391e5b411b6d29a7656e59bd6e7658c6a/zap/player.py#L372-L375 Could you try a single seek if you get playback working? |
@caffeinepills Thanks for getting back to me. I indeed had to override the
I actually just had a look at my customized The temp file loading I do is because I play files directly from a ZIP file, and for this to work, I apparently need to first unzip the file I want to play into a temporary file on disk. I am getting somewhere, though! With one simple change (apparently the DirectSound However, I still cannot get the more important If you could maybe have a look at that part (starting from line 389) and in particular how I seek and how I update this player (every 100ms), that would be great! Maybe you spot the issue immediately, given that you are familiar with the internal changes in 2.0.12. Btw., for actually loading a ZippedAlbum, you could download any free album from Bandcamp in FLAC format, for instance this (random pick; click on "Buy album" and under "name your price" put in 0). |
The changes are very wide, but were supposed to have no effect on users. zap suffers from two other issues, but both of those are related to internal access, so fair game for a minor version change: This is a hack capable of fixing the primary issue, although if possible it's probably preferrable to wait on pyglet try:
from pyglet.media.codecs import PreciseStreamingSource
def _saf(s, f): s._source.audio_format = f
def _svf(s, f): s._source.video_format = f
def _sin(s, i): s._source.info = i
PreciseStreamingSource.audio_format = property(lambda s: s._source.audio_format, _saf)
PreciseStreamingSource.video_format = property(lambda s: s._source.video_format, _svf)
PreciseStreamingSource.info = property(lambda s: s._source.info, _sin)
PreciseStreamingSource.duration = property(lambda s: s._source.duration)
except ImportError:
pass |
Thanks for the snippet. Adding this to the beginning of Zap's Concerning the two issues you mention: |
* Remove `PreciseStreamingSource`; Move back audio buffering into players.
As described here, the major breaking audio changes that have been introduced in 2.0.12 have effects on other software that relies on Pyglet for audio playback (in my case https://github.com/zipped-album/zap).
Due to the lack of documentation of these changes, it is not straight-forward to make already existing (now broken) code - which worked fine in Pyglet 1 and Pyglet 2 (until 2.0.12) - work again.
Assuming that 2.0.10 will not be maintained in parallel in the future, a migration guide, which explains the changes in detail and gives step-by-step instructions on what parts need adaptation, would help with migrating existing software to 2.0.12 and beyond.
The text was updated successfully, but these errors were encountered: