[Numpy-discussion] Converting audio data to array for further processing

Gabriel J.L. Beckers beckers@orn.mpg...
Tue Aug 26 03:27:42 CDT 2008


I would go with scikits.audiolab to get you wav data into numpy arrays,
as David mentioned. I use it all the time for bioacoustic research and
it is great (unfortunately still in beta, but works well in practice).

Reading sound data of 5 seconds @ 32000 Hz and finding/measuring your
tones fast should not be a problem with numpy(.fft) and audiolab.

If you need very accurate tone frequency estimation (i.e. more accurate
than a simple fft can give you): I implemented in numpy an algorithm
(from the speech analysis program Praat) to do this, but as yet it is
not optimized and very slow.

Best, Gabriel

On Mon, 2008-08-25 at 17:25 -0600, Dan Colesworthy wrote:
> Hello all,
> 
>  
> 
> I need an efficient way to convert 24 bit signed audio data to a numpy
> array for further processing.  The data will be in a .wav file, and
> can be recovered via the python wave module.  At that point it is a
> byte string – likely in little endian order.  Somewhere in that data
> will be a 1 second length tone of prescribed but varying amplitude and
> frequency which must be measured for amplitude, frequency, duration,
> thd% etc.
> 
>  
> 
> Also need to make the conversion quickly – over relatively large
> amounts of data.  Something like 5 seconds sampled at 32000
> samples/second.  This same job will have to be repeated > 300 times as
> part of a test module. 
> 
>  
> 
> Thanks in advance for any and all ideas.
> 
>  
> 
> Dan Colesworthy
> 
> Otologics LLC
> 
>  
> 
> 
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion




More information about the Numpy-discussion mailing list