Question
Search the web and download an Antelope and a Rabbit sounds to your computer- already done Write a program in Python to take samples from
Search the web and download an Antelope and a Rabbit sounds to your computer- already done
Write a program in Python to take samples from both sounds and then blend them
To do this, copy part of the Antelope sound, then add 50% of each, and then copy the sound of the Rabbit.
Use loops for each segment of the blended sound
Start out by creating/making the Antelope & rabbit sounds, and a silent sound canvas that we will be blending into. Note. Please call the pickAFile method to browse the sounds. DO NOT pass paths
I have my code so far for JES, but it is missing something in the beginning. Please help me learn how to insert sound wav file.
def blendSounds(): antelope=makeSound() rabbit=makeSound() canvas=makeEmptySoundBySeconds(3) for index in range(0,20000): rabbitSample=getSampleValueAt(rabbit,index) setSampleValueAt(canvas,index,rabbitSample) for index in range(0,20000): rabbitSample=getSampleValueAt(rabbit,index+20000) antelopeSample=getSampleValueAt(antelope,index) newSample=0.5*rabbitSample+0.5*antelopeSample setSampleValueAt(canvas,index+20000,newSample) for index in range(20000,40000): antelopeSample=getSampleValueAt(antelope,index) setSampleValueAt(canvas,index+20000,antelopeSample) play(canvas) return
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started