Python audio playback library that supports cue sheets - python

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!

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.

Related

find out which programs play sound python Python

I want to find out which programs are playing sound with a python code, I researched it a lot, even though I tried libraries like winsdk pycaw, I couldn't get any results
The simplest way is to use standard winsound module. Please, refer to documentation
If you are now under Windows, there are:
the bell character on the terminal
AppKit to play MacOS system sounds
pygame to play custom sound files
simpleaudio to play custom sound files
the beepy package

Start programs in full-screen (Python)

I tried to open a file, the filename is 1.txt. I tried to open it with webbrowser.open("1.txt") or os.startfile("1.txt") which worked perfectly fine, but I couldn't find any information about how to start programs or anything with Python in full screen. I'm using Linux and Python 3.6.
Any ideas how to perform something like that?
There are more answers to that question than there are GUI toolkits, and there are plenty of toolkits.
I think the first thing you need to do is decide on a GUI toolkit. Research it depending on your necessities (python version, OS support, etc). Once you settle on one, find out how to make a fullscreen app with that. If you can't, ask again.
Good luck.

Python tkinter multiplatform icon formats

I'm starting with tkinter with Python3 and I found some issues in Ubuntu practising with the exercises when coming to icons.
I'm reading Mark Lutz's "Programming Python" and he uses a ".ico" file, but it does not work in Ubuntu. I got curious and started to search on the web, and it seems that few icon formats work (.xbm) in Ubuntu, less in color mode.
I was googling and also found that using PIL or pillow is useful for managing and using color icons in tkinter applications and GUIs, but I didn't found yet any piece of code or detailed explanation on how to use an ".ico" file for an icon in a tkinter GUI in a portable way.
I find pretty weird as well not finding some reusable piece of code or library/module which takes a graphics file and returns some kind of usable icon object ready for being used.
Any reccomendation? Am I searching badly?
I suppose a good alternative is having some software to convert formats, but I would prefer the best code-oriented solution with multiplatform applications in mind and as many supported formats as possible.
Edit: For making this clear, when I talk about icons, I'm referring to icons, those little images in the top-left corner of our windows or in the OS bar when minimized. This isn't about any other kind of image in labels, buttons or other widgets (I don't even think that should be called an icon)
Thanks in advance

PyGObject or PyGtk

I need to write a program on my Raspberry Pi to get a video and audio stream with Gstreamer from network and play them.(I have two stream. one for video and one for audio) and i need a custom GUI. I followed the below link :
http://www.jonobacon.org/2006/08/28/getting-started-with-gstreamer-with-python/
It used PyGtk and I want to switch to PyGObject. my question is : does PyObject support Gstreamer as well as PyGTK? or I should stuck to PyGTK? Or do you have a better solution to do that on Raspberry Pi
Considering the age of the article you linked, you might already know that there are newer versions of the libraries around. PyGtk and PyGst don't provide bindings for these.
Python GObject Introspection supports the Gkt-3.0 and Gst-1.0 versions. So you're safe using PyGObject for your program.
There's a quite good documentation on lazka.github.io/pgi-docs/ covering a lot more bindings as well.
Besides if you're going to build an audio/video player have a look at the playbin element. It's a complete pipeline supporting an audio-, a video- and a text-sink at once.

Playing and controlling mp3 files in Python?

First things first, I am a Python beginner, with a typical C++/Java background for object oriented stuff.
I was convinced to try Python for this current endeavor I am working on, and so far I like it. One issue I am having though is finding a good mp3 module.
I have tried TkSnack, which installed and ran fine with no errors(as long as my audio device wasn't busy) but it could never actually produce a sound, it just did nothing... I went online for help, and was disappointed with the amount of documentation.
So I decided to switch. I tried PyMad because it is in the standard repositories for Ubuntu as well. There was even less documentation on this, but I could make it play a sound. The only problem is that it requires a loop to constantly write/play the audio buffer. This makes it particularly hairy to handle playback control(in my opinion) cause I would have to run this in a separate thread or process, and somehow control the seek position for pause and such. This is a little too low level for why I am using Python. I liked the simplicity of TkSnack for its easy commands like "mysound.play()" or "mysound.pause()" rather than controlling a loop.
I also looked at pyMedia, which looks like it is the most up to date with documentation, but I can't get it to install on my machine. I get a "gcc exited with value 1" error or something like that when running the "python setup.py build" command.
So I am looking for any suggestions or help on one of these modules, or a completely different one, that is high level and easy to use for mp3s(and preferably other formats too) I am trying to have basic playback control(pause, stop, skip, seek) and I may also be streaming files too eventually(if I ever get there).
EDIT: I like the python bindings for Gstreamer, but is this a cross-platform solution?? I forgot to mention that as a requirement. But I always just associated GStreamer with Linux, would this work on other OSs?
EDIT: Wikipedia says yes.
Sorry I can't help you with PyMad or pyMedia, but I have other suggestions.
Existing music players written in Python:
Exaile
FUPlayer
Listen
All of the above use the Python bindings for the GStreamer multimedia framework. Docs for the bindings are scarce, but check here, here, here, and examples from the source distribution here.
I just had to deal with this, and from my research I think your best bets are pyglet and pygame. They're interface packages with built-in a/v support.

Categories