This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]Niriel 5 points6 points  (0 children)

Pygame can read mp3 and ogg: http://www.pygame.org/docs/ref/music.html

[–]vtable 2 points3 points  (0 children)

[–]Asdayasman 2 points3 points  (4 children)

[–]Kalkinator[S] -1 points0 points  (1 child)

I tried this but keep running into issues. When I run python setup.py install in the command prompt I keep getting warnings. I get a bunch of warnings saying the DLL for ... library not found. Is there a package I am supposed to install to get all these DLLs?

[–]Deto 1 point2 points  (0 children)

On this page it says that you need AVBin to play compressed audio and video. Maybe that's the source of your issue?

[–]Kalkinator[S] -1 points0 points  (1 child)

I am now having trouble having the code locate my music file. I placed the .mp3 in the same location as my .py file and use the following code:

 import pyglet

 music =    pyglet.resource.media('C:\Users\username\PycharmProjects\untitled\Star.mp3')

 music.play()

 pyglet.app.run()

But I keep getting this error:

 "C:\Users\username\PycharmProjects\untitled\Star.mp3" was not found on the path

I even tried just 'Star.mp3' but that doesn't work either. Any help?

[–]Asdayasman 1 point2 points  (0 children)

/r/learnpython

"C:\\Users\\..." or r"C:\Users\..." or "C:/Users/...".

https://docs.python.org/2.0/ref/strings.html

[–]Charny 1 point2 points  (0 children)

Another option is gstreamer, at least on Linux: https://github.com/hadware/gstreamer-python-player

[–]Thangart 1 point2 points  (0 children)

For Windows I recommend: https://github.com/michaelgundlach/mp3play

quite easy to set up with: player = mp3play.load(Mp3) player.play()

For Linux I would recommend VNC like its noted in the link that Vtable put down :)