[Pkg-octave-devel] Re: Bug#408268: marked as done (octave2.9-forge: wavwrite writes invalid WAV files)

Thomas Weber thomas.weber.mail at gmail.com
Sun Feb 4 21:53:30 CET 2007


Am Sonntag, 4. Februar 2007 21:11 schrieb Rafael Laboissiere:
> > Eh, in that case a file with only one channel should be written,
> > shouldn't it?
>
> Indeed:
>
> $ octave2.9 -q
> octave2.9:1> wavwrite('noise.wav', randn(65536,1));
> warning: wavwrite: sample rate set to 8000 Hz
> warning: wavwrite: sample resolution set to 16-bit
> octave2.9:2> exit
> $ file noise.wav
> noise.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit,
> mono 8000 Hz $ ls -l noise.wav
> -rw-r--r-- 1 rafael rafael 131116 2007-02-04 21:10 noise.wav

Yes, but if I write a .wav-file with a 1x50000 matrix, the resulting file 
should have 50000 channels. The current code however generates a file with 
32767 channels.

octave2.9:1> a = rand(1,50000);
octave2.9:2> wavwrite('noise.wav', a)
octave2.9:3> system ("file noise.wav")
noise.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, 32767 
channels 8000 Hz
ans = 0


	Thomas



More information about the Pkg-octave-devel mailing list