For improving the join of two wave files
Posted
by kaki
on Stack Overflow
See other posts from Stack Overflow
or by kaki
Published on 2010-06-16T09:51:23Z
Indexed on
2010/06/16
9:52 UTC
Read the original article
Hit count: 203
python
i want to get the values of the last 30 frames of the first wav file and first thirty frames of the second wave file in integer format and stored in a list or array.
i have written the code for joining but during this manupalation i am getting in byte format and tried to convert it to integer but couldn't.
as told before i want to get the frame detail of 1st 30 and last 30 in integer format,and by performing other operations join can be more successful
looking for your help in this,please...
thanking you,
import wave
m=['C:/begpython/S0001_0002.wav', 'C:/begpython/S0001_0001.wav']
i=1
a=m[i]
infiles = [a]
outfile = "C:/begpython/S0001_00367.wav"
data= []
data1=[]
for infile in infiles:
w = wave.open(infile, 'rb')
data1=[w.getnframes]
#print w.readframes(100)
data.append( [w.getparams(), w.readframes(w.getnframes())] )
#print w.readframes(1)
#data1 = [ord(character) for character in data1]
#print data1
#data1 = ''.join(chr(character) for character in data1)
w.close()
print data
output = wave.open(outfile, 'wb')
output.setparams(data[0][0])
output.writeframes(data[0][1])
output.writeframes(data[1][1])
output.writeframes(data[2][1])
output.close()
© Stack Overflow or respective owner