# Making a wav file from a list of numbers in Mathematica

I have a list of numbers from a simulation of acoustic pressure generated by a virtual musical instrument by another program (Comsol multiphysics). I would like to "hear" the tone produced by different settings in the virtual instrument.

How can I do this? In particular, can I convert the data into a .wav file?

• Could you please provide a sample of your data? Or give a link to where it can be found. Dec 2, 2012 at 6:48
• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the FAQs! 3) When you see good Q&A, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. ALSO, remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign Dec 2, 2012 at 9:35

In Mathematica it is easy to turn any time series data into sound. Here are the Boston temperatures for a few decades:

data = WeatherData["Boston", "MeanTemperature", {{1970}, {2012}, "Day"}];
DateListLogPlot[data, PlotStyle -> PointSize[0], AspectRatio -> 1/5]


To turn it into sound and play it in a Mathematica notebook:

ListPlay[data[[All, 2]], SampleRate -> 2000]


To export to .wav file:

Export["test.wav", %]

• +1 Very nice example! I personally like the sound of the RiemannZeta function. Dec 2, 2012 at 18:44
• @Matariki Thanks! I am not sure about sampling rate for RiemannZeta and other details. Will your code fit in a comment? Dec 2, 2012 at 19:51
• Its rather simple. I got it years back I think it was a Mathematica example. Play[RiemannSiegelZ[2000 t], {t, 0, 5}, PlayRange -> {-20, 20}]` Dec 2, 2012 at 20:01