Playing MP3 files with Python

后端 未结 3 872
野趣味
野趣味 2021-01-04 19:34

I\'m trying to write my own media player (like Foobar), and I\'m having trouble tracking down a Python library that\'ll play MP3s. I know Pymedia does mp3s, but it looks out

相关标签:
3条回答
  • 2021-01-04 20:27

    There is http://pyglet.org/ and also have you tried http://code.google.com/p/mp3play/? It's also available from PyPi (http://pypi.python.org/pypi/mp3play/) However, I think mp3play is Win32 only for now.

    Looking at the updates, there were commits within last couple of months.

    0 讨论(0)
  • 2021-01-04 20:28

    I've been using PyMedia in Python 2.6.5 on Windows successfully. Caveats: the documentation is bad and wrong -- many of the tutorials have glaring errors or otherwise don't work -- so I had to do some experimentation and Googling to get my code to work right. Also for whatever reason the maintainers seem to have stopped updating the project site 4 years ago, though they seem to be actively doing something.

    I found installers here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

    The semi-active forum linked from their website includes some code maintainers who are semi-helpful. I'm jboyd99 if anyone is looking for tips.

    For reasons that are beyond me the focus is on car audio systems, despite the fact that it is a fairly fully featured library that does some things no other free Python library does, like read MP3s into raw PCM data. The library has some flaws -- I'll probably use PyAudio or PyAudiere for actual playback for better control of synchrony issues.

    0 讨论(0)
  • 2021-01-04 20:36

    Maybe it'd be simpler to write that part of your application in Python 2.4 as a separate "backend". This way you could use PyMedia (http://pymedia.org/) (as you mentioned) for the actual playback. It'd allow you to write your GUI in another Python version (like 2.6), which would also mean more decoupling of program components and parallelism (smoother GUI).

    If you target only the Windows platform, then using Media Player via COM might help:

    http://www.daniweb.com/code/snippet216465.html

    0 讨论(0)
提交回复
热议问题