Knowledge Base‎ > ‎Programming‎ > ‎Python‎ > ‎

how to play sounds

 at the top with your global variables import the following and then load the audio file

#import pyglet.media
from pyglet.media import StaticSource, load
beep = StaticSource(load("/Users/jcordiner/Desktop/3375__suonho__cartoonist_05_down_suonho_.wav", streaming=False))

then inside your draw or UI functions call the play method :

beep.play()


unzip and place the dll in your windows system32 folder


Comments