Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2013 14:53
Show Gist options
  • Save anonymous/4493711 to your computer and use it in GitHub Desktop.
Save anonymous/4493711 to your computer and use it in GitHub Desktop.
Using pyglet to play a file. You require avbin installed from their site and the following packages in Ubuntu: python-pyglet libglu1-mesa-dev freeglut3-dev mesa-common-dev libopenal-dev libalut-dev
#!/usr/bin/env python
import pyglet
mp3 = "test.mp3"
source = pyglet.media.load(mp3)
player = pyglet.media.Player()
player.queue(source)
player.play()
pyglet.app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment