After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 491552 - bsewavetool info command is incorrect on > 1 channel files
bsewavetool info command is incorrect on > 1 channel files
Status: RESOLVED FIXED
Product: beast
Classification: Other
Component: tools
SVN trunk
Other Linux
: Normal normal
: m0.7
Assigned To: Beast Maintainers
Beast Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-29 23:54 UTC by Stefan Westerfeld
Modified: 2007-10-31 19:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggested patch for better length output (2.34 KB, patch)
2007-10-30 17:18 UTC, Stefan Westerfeld
none Details | Review

Description Stefan Westerfeld 2007-10-29 23:54:53 UTC
The duration and the number of samples are computed wrong for such files.
Comment 1 Tim Janik 2007-10-30 01:50:21 UTC
(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.
Comment 2 Stefan Westerfeld 2007-10-30 17:18:56 UTC
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.
Comment 3 Tim Janik 2007-10-31 14:41:30 UTC
(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.
Comment 4 Stefan Westerfeld 2007-10-31 19:18:10 UTC
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.