GNOME Bugzilla – Bug 491552
bsewavetool info command is incorrect on > 1 channel files
Last modified: 2007-10-31 19:18:10 UTC
The duration and the number of samples are computed wrong for such files.
(In reply to comment #0) > The duration and the number of samples are computed wrong for such files. please provide a patch that shows what you mean to change. or be more specific in your error descriptions, there's a reason the standard bug report form has fields for "expected outcome" and "actual outcome", people reviewing bug reports need this information.
Created attachment 98188 [details] [review] Suggested patch for better length output Sure. The old output was like this: stefan@lotrien64:/usr/local/src/beast/tools$ bsewavetool info /usr/local/src/freerompler/pad1.bsewave --pretty=full LOAD: /usr/local/src/freerompler/pad1.bsewave EXEC: info Wave Label pad1 Channels 2 Chunk 'tUjOAVR' Osc Freq 55.00 Hz Mix Freq 44100.00 Hz Samples 88280 (2.00 s) Stored as raw data Avg Energy -9.67 dB Loop type jump (start: 0, end: 44099, count: 1000000) ... This was not what I expected, and with the patch I am getting the expected output, which is like this: stefan@lotrien64:/usr/local/src/beast/tools$ bsewavetool info /usr/local/src/freerompler/pad1.bsewave --pretty=full LOAD: /usr/local/src/freerompler/pad1.bsewave EXEC: info Wave Label pad1 Channels 2 Chunk 'tUjOAVR' Osc Freq 55.00 Hz Mix Freq 44100.00 Hz Samples 44140 (1.00 s) Stored as raw data Avg Energy -9.67 dB Loop type jump (start: 0, end: 44099, count: 1000000) ... There you see also the motivation why I wanted the sample count changed: this loop over (almost) the whole sample is in the range [0,44099]. Then it is not very useful if bsewavetool tells me there are 88280 samples (as in datahandle values) in the file. I would then be assuming that I'm only looping half the file. That the seconds count needs to be corrected is obvious because when I listen to the file its really 1 second, not 2 seconds as the old bsewavetool code mistakenly says.
(In reply to comment #2) > Created an attachment (id=98188) [edit] > Suggested patch for better length output thanks, the patch looks good to me. the actual problem as i perceive it is that "sample" is used to mean so many things. i think if you changed the output name from "Samples" to "Sample Frames", it'd be more clear that 1 sample frame maps to x sample values for x channels.
Committed with "Sample Frames" and "sample frames" used at the appropriate places in the code and --help output. Wed Oct 31 20:07:30 2007 Stefan Westerfeld <stefan@space.twc.de> Fix bsewavetool info output for multichannel samples #491552. * tools/bsewavetool.cc: When computing the sample count and the sample length in seconds, take into account the number of channels.