31 lines
688 B
Python
31 lines
688 B
Python
# import pyglet
|
|
# from time import sleep
|
|
|
|
# explosion = pyglet.media.load("bell.wav", streaming=False)
|
|
# explosion.play()
|
|
# pyglet.clock.tick()
|
|
# sleep(1)
|
|
|
|
# explosion = pyglet.media.load("bell.wav", streaming=False)
|
|
# explosion.play()
|
|
|
|
# sleep(1)
|
|
|
|
# explosion = pyglet.media.load("bell.wav", streaming=False)
|
|
# explosion.play()
|
|
|
|
# sleep(1)
|
|
|
|
# explosion = pyglet.media.load("bell.wav", streaming=False)
|
|
# explosion.play()
|
|
|
|
# while True:
|
|
# # pyglet.clock.tick()
|
|
# sleep(0.2)
|
|
|
|
import miniaudio
|
|
|
|
stream = miniaudio.stream_file("bell.wav")
|
|
with miniaudio.PlaybackDevice() as device:
|
|
device.start(stream)
|
|
input("Audio file playing in the background. Enter to stop playback: ")
|