User:Ozalp Eroz/buzz

From XPUB & Lens-Based wiki

from os import system
import time

system('sox -c1 -r8000 -n -t wav - synth 2.0 sine 20 vol 30.0 > a1.wav')
system('sox -c1 -r8000 -n -t wav - synth 2.0 sine 20 vol 20.0 > a2.wav')
system('sox -c1 -r8000 -n -t wav - synth 2.0 sine 20 vol 10.0 > a3.wav')

system('sox a1.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer a1.raw')
system('sox a2.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer a2.raw')
system('sox a3.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer a3.raw')



for i in range(2):

system("cat a3.raw >> buz.raw")

       system("cat a2.raw   >> buz.raw")
system("cat a1.raw >> buz.raw")


       for i in range(2):


system("cat a2.raw >> buz.raw")

               system("cat a1.raw   >> buz.raw")
system("cat a3.raw >> buz.raw")


system("sox --rate 44100 --bits 16 --channels 2 --encoding signed-integer buz.raw buz.wav")

system("rm buz.raw")
system("play buz.wav")

Attachments