Tutorial by Examples

import pyglet audio = pyglet.media.load("audio.wav") audio.play() For further information, see pyglet
winsound Windows environment import winsound winsound.PlaySound("path_to_wav_file.wav", winsound.SND_FILENAME) wave Support mono/stereo Doesn't support compression/decompression import wave with wave.open("path_to_wav_file.wav", "rb") as wav_file: #...
from subprocess import check_call ok = check_call(['ffmpeg','-i','input.mp3','output.wav']) if ok: with open('output.wav', 'rb') as f: wav_file = f.read() note: http://superuser.com/questions/507386/why-would-i-choose-libav-over-ffmpeg-or-is-there-even-a-difference What are ...
Windows provides an explicit interface through which the winsound module allows you to play raw beeps at a given frequency and duration. import winsound freq = 2500 # Set frequency To 2500 Hertz dur = 1000 # Set duration To 1000 ms == 1 second winsound.Beep(freq, dur)

Page 1 of 1