tags:

views:

48

answers:

3

I want get the details of the wave such as its frames into a array of integers. Using fname.getframes we can ge the properties of the frame and save in list or anything for writing into another wav or anything,but fname.getframes gives information not in integers some thing like a "/xt/x4/0w' etc..

But i want them in integer so that would be helpful for manupation and smoothening join of 2 wav files

+1  A: 

I don't know what library you're using, but it looks like it's probably returning a string of bytes. To get it into a list of integers, you could do something like this:

data = [ord(character) for character in data]

To convert it back, you could do something like this:

data = ''.join(chr(character) for character in data)
icktoofay
A: 

NumPy can load the data into arrays for easy manipulation. Or SciPy. I forget which.

Ignacio Vazquez-Abrams
+1  A: 

If you need to convert the frame data into integers, you can create an array.array('h') (array of signed 16-bit words) and load it from the frame data using its .fromstring or .fromfile methods.

However, I'm almost sure that you can keep the frame data as they are, and manipulate them using functions in the audioop module.

ΤΖΩΤΖΙΟΥ