There used to be a Python module called pyglet that allowed graphics and sound. I can't find it anywhere.

Recommended Answers

All 3 Replies

Thanks, I got it to go!

''' pyg_Sound1.py
playing sound files using pyglet
download and install
pyglet-1.2alpha1.win32-py2.7.exe
from
http://www.lfd.uci.edu/~gohlke/pythonlibs/

avbin.dll is included
so pyglet can play .wav  .mp3  .ogg sound files
(but not .mid Midi files)
'''

import pyglet

# pick a sound file you have, or one of those below
# in this case file names are case sensitive
#sound_file = 'drums.ogg'
#sound_file = 'cool_f.wav'
sound_file = 'Boing.mp3'

music = pyglet.media.load(sound_file)
music.play()

pyglet.app.run()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.