[SciPy-user] from 1-d array to wave file?

Steve Schmerler elcorto@gmx....
Wed Oct 24 06:42:27 CDT 2007


massimo sandal wrote:
> Hi,
> 
> Is there an easy way to transform a vector of data into a wave file?
> Let's say, if I have something like:
> 
> import numpy as np
> a=np.arange[0,100,0.1]
> b=[np.sin(item) for item in a]
> 
> how can I convert b into a wave file (with given sampling rate, etc.)? 
> Is there an easy recipe?
> 

Google truns up http://docs.python.org/lib/module-wave.html.
BTW, why don't you do
b = np.sin(a) ?

-- 
cheers,
steve

Random number generation is the art of producing pure gibberish as quickly as 
possible.


More information about the SciPy-user mailing list