savewave and wavwrite write null signal if 24 bits resolution and more than 2 channels
Reported by Yves Guillemot
BUG DESCRIPTION:
----------------
A 3 ou 4 channels .wav file created with savewave ou wavwrite only contains null data if a 24 bits resolution was specified.
All works fine if the file is created with less than 3 channels or with a 16 or 32 bits resolution.
ERROR LOG:
----------
No visible reported error.
HOW TO REPRODUCE THE BUG:
-------------------------
Execute the following commands :
s=[sin([1:0.1:100]);sin([1:0.1:100]);sin([1:0.1:100])]; // Create a 3 channels waveform data
wavwrite(s,22500,16,"A.wav"); // Write it with 16 bits resolution in A.wav
wavwrite(s,22500,24,"B.wav"); // Write it with 16 bits resolution in B.wav
wavwrite(s,22500,32,"C.wav"); // Write it with 16 bits resolution in C.wav
A.wav and C.wav contains the correct data but B.wav only contains zeros as shown with:
a=wavread("A.wav");
plot((a(1,:)); // Shows the correct sinus waveform
b=wavread("B.wav");
plot((b(1,:)); // Only shows a flat line
c=wavread("C.wav");
plot((c(1,:)); // Shows the correct sinus waveform
OTHER INFORMATION:
------------------