0

I'm looking for a Python audio playback library that supports cue sheets. I found a good list of libraries here, but none of them seem to work with cue sheets (at least not from what I've seen in their documentations). Is there anywhere I can find something like this?

I would prefer if it's something that can work with PYQT5, but it's fine if there isn't anything like that!

PrimeNumbers
  • 117
  • 1
  • 8

1 Answers1

0

I ended up deciding to use QMediaPlayer (part of PyQt5), along with this logic.

I had to install K-Lite codec on my computer, otherwise it would only play .wav files. Here is the download link for that.

Edit: QMediaPlayer ended up not supporting gapless playback, so I switched to pyglet which works for non-mp3 files. pyglet can also be used with PyQt5 because pyglet.app.run() without a pyglet window can play the audio in the background, which can be controlled from the GUI application running on PyQt5.

However as Denis pointed out in the comment to this, there are many other issues I hadn't considered.

PrimeNumbers
  • 117
  • 1
  • 8
  • 1
    Based on my experience if you want proper support for cue files, you'd have to have gapless playback and sample accurate seek, which means you'd have to run decoding and playing the sound yourself. I doubt there's a library ready to support all of that. I had a project in java that had a bunch of these things: https://github.com/tulskiy/musique. Maybe it could be a source of inspiration. – Denis Tulskiy Jul 05 '20 at 20:52
  • @DenisTulskiy, I think I can get cue files to work without gapless playback (though I did find out that pyglet supports it for non-mp3 files) by simply playing the selected tracks as a single segment starting from the minimum time and ending at the maximum. But I hadn't considered the problem of accurate seeking, which, as I just tested out, is very bad. Thanks for the link to your project, it looks very similar to what I'm trying to make, it will be a lot of help. – PrimeNumbers Jul 05 '20 at 22:18
  • 1
    deadbeef is another good inspiration: https://deadbeef.sourceforge.io/ – Denis Tulskiy Jul 08 '20 at 04:20