random python winsound merge 1 2 and 3.wav
by gis_sweden
0:00 / 0:14
Download on Freesound
Description
I made a small Python program that generates 20 random beeps.
I record the outcome.
I cut the result so that the first beep starts after 0.01 sec
The file ends right after the last beep.
(I'm a Python noob... If you find something you don’t like in the code please let me know.)
In this sound I have joined three "beep files".
Sound 1 panned to the left
Sound 2 in the center
Sound 3 panned to the right
# GIS_SWEDEN 20170531 - Random Beep In Python :-)
import winsound
import random
import time
beepnr = 1
while beepnr < 21:
freq = random.randrange(1000)+110
dur1 = random.randrange(700)+20
dur2 = random.randrange(10)+2
winsound.Beep (freq, dur1)
time.sleep(dur2/10)
print 'Beep Number', beepnr
beepnr = beepnr + 1
I record the outcome.
I cut the result so that the first beep starts after 0.01 sec
The file ends right after the last beep.
(I'm a Python noob... If you find something you don’t like in the code please let me know.)
In this sound I have joined three "beep files".
Sound 1 panned to the left
Sound 2 in the center
Sound 3 panned to the right
# GIS_SWEDEN 20170531 - Random Beep In Python :-)
import winsound
import random
import time
beepnr = 1
while beepnr < 21:
freq = random.randrange(1000)+110
dur1 = random.randrange(700)+20
dur2 = random.randrange(10)+2
winsound.Beep (freq, dur1)
time.sleep(dur2/10)
print 'Beep Number', beepnr
beepnr = beepnr + 1
Ad Space