How to manipulate wav file data in Python?
I'm trying to read a wav file, then manipulate its contents, sample by sample
Here's what I have so far:
import scipy.io.wavfile
import math
rate, data = scipy.io.wavfile.read('xenencounter_23.wav')
for i in range(len(data)):
    data[i][0] = math.sin(data[i][0])
    print data[i][0]
The result I get is:
0
0
0
0
0
0
etc
It is reading properly, because if I write print data[i] instead I get
usually non-zero arrays of size 2.
 
No comments:
Post a Comment