Python Forum

Full Version: WaveCopy and Amplitude Scaling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In this assignment you will generate code to read a (short) .wav audio file into python, copy and amplitude scale it, before writing it out to a new .wave file.
1. Read a few seconds of .wav file of your choosing into a Numpy array.
2. Duplicate the first or last half of the array and concatenate it onto the end of the original array at half the amplitude.
3. Amplitude scale the whole array to √2-1
4. Plot the resulting audio array.
5. Write the array to a .wav file
Submit .py code and original .wave file
Bonus assignment grade bump:
6. Repeat 2 and 3 a user-determined number of times to produce a
decaying echo effect.


Hello!
first time posting here. I am in an intro to coding, and I was told that this would be the best way of reaching help outside of class.

We usually create the wav. file, but this time we are using an existing wav file and trying to put into an array. I am using a wav. file called "glassbreak.wav" as an example. But I do not understand how to work it through this assignment. Where do I start?

Thanks!
I don't know how to import sounds and stuff into python but you should learn the following concepts to achieve the rest -
1. Learn how arrays work
2. If I'm correct it said repeat based on how many times the user wants, for that use input
3. For repeating you can use a for loop
repeat = input('Some text - ')
for i in range(1, repeat + 1):
    #Some Code
We don't usually write code for you, especially if a homework assignment.
Write some code, and ask questions on particular issues.
We will be glad to help.
(Apr-22-2019, 08:39 PM)Larz60+ Wrote: [ -> ]We don't usually write code for you, especially if a homework assignment. Write some code, and ask questions on particular issues. We will be glad to help.
(Apr-22-2019, 08:39 PM)Larz60+ Wrote: [ -> ]We don't usually write code for you, especially if a homework assignment. Write some code, and ask questions on particular issues. We will be glad to help.
thats exactly what I need help with. I wrote the code for making the wav, but this time we are using a different wav. file.