BUG DESCRIPTION:
----------------
Documentation for wavread contains a slight error. It says
wavread(wavfile,'info') returns information about the audio data contained in the file in place of the actual audio data, returning the vector as [data format, number of channels, samples per second per channel, estimate of bytes per second needed, byte alignment of a basic sample block, bits per sample, length of sound data in bytes, bytes per sample (per channel)].
The two last items should be reversed and reworded. See "OTHER INFORMATION" for details.
ERROR LOG:
----------
Not applicable
HOW TO REPRODUCE THE BUG:
-------------------------
Fs = 44100;
f = 100;
t = 0:1/Fs:0.1;
// Create stereo signal
x = [sin(2*%pi*f*t); cos(2*%pi*f*t)];
// Save signal
wavwrite(x, Fs, 'c:\test.wav')
// Retrieve wav file info
H = wavread('c:\test.wav')
Result:
H =
1. 2. 44100. 176400. 4. 16. 2. 4411.
As can be seen, the last two are flipped (4411 cannot be the number of bytes per sample...).
OTHER INFORMATION:
------------------
Suggested improvement:
wavread(wavfile,'info') returns information about the audio data contained in the file in place of the actual audio data, returning the vector as [data format, number of channels, sampling rate, average bytes per second needed, byte alignment of a basic sample block, bits per sample (per channel), bytes per sample (per channel), length of sound data in samples].
Changes:
samples per second per channel ---> sampling rate
(this is the official name in the wave file format specification and standard in digital signal processing)
estimate of bytes per second needed ---> average bytes per second needed
(the official concept slightly shortened, the estimate is for buffering purposes for real-time streaming)
bits per sample ---> bits per sample (per channel)
(to be consistent with next item)
length of sound data in bytes ---> length of sound data in samples
(if given in bytes it should be this number multiplied by number of channels and number of bytes per sample)
last two items flipped over to be consistent with the actual result
Final optional suggestion: change "in place of" ---> "instead of". It is more idiomatic in English, see:
https://books.google.com/ngrams/graph?content=in+place+of%2C+instead+of&case_insensitive=on&year_start=1800&year_end=2008&corpus=15&smoothing=3&share=&direct_url=t4%3B%2Cin%20place%20of%3B%2Cc0%3B%2Cs0%3B%3Bin%20place%20of%3B%2Cc0%3B%3BIn%20place%20of%3B%2Cc0%3B.t4%3B%2Cinstead%20of%3B%2Cc0%3B%2Cs0%3B%3Binstead%20of%3B%2Cc0%3B%3BInstead%20of%3B%2Cc0