Possible bug in WAV export
- To: mathgroup at smc.vnet.net
- Subject: [mg87569] Possible bug in WAV export
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Sun, 13 Apr 2008 03:32:24 -0400 (EDT)
- Organization: University of Bergen
Something is wrong with WAV export. I tried the following:
snd = Play[
Sin[440 2 \[Pi] t] + Sin[2 440 2 \[Pi] t] + Sin[3 440 2 \[Pi] t] +
Sin[4 440 2 \[Pi] t], {t, 0, 1}, SampleRate -> 44100,
SampleDepth -> 16]
Export["test.wav", snd, "WAV"]
The produced WAV file has a terrible buzzing sound, which is nothing
like the sound played in Mathematica.
Re-importing it and plotting the data shows that some of the samples are
missing (they have the most negative value):
data = Import["test.wav"][[1, 1, 1]];
ListPlot[Take[data, {200, 500}], Joined -> True]
(AIFF and FLAC export appear to be working correctly in this case.)