Skip Menu |

This queue is for tickets about the Audio-Wav CPAN distribution.

Report information
The Basics
Id: 57114
Status: resolved
Priority: 0/
Queue: Audio-Wav

People
Owner: Nobody in particular
Requestors: sergstesh [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: off by one max value in Audio::Wav::Write usage example
Date: Sat, 1 May 2010 08:05:16 -0700 (PDT)
To: bug-Audio-Wav [...] rt.cpan.org
From: Sergei Steshenko <sergstesh [...] yahoo.com>
Hello, looking at http://search.cpan.org/~brianski/Audio-Wav-0.11/Wav/Write.pm I see: my $max_no = ( 2 ** $bits_sample ) / 2; . Well, it should really be my $max_no = ( 2 ** $bits_sample ) / 2 - 1; - this is because for, say, 16 bit WAV file/signed integer the range is -32768 .. 32767, so that '32767' rather than 32768 is the reason for subtracting 1. Thanks, Sergei.
Thanks! This is fixed in SVN and hopefully I'll have a chance to roll a new release out soon. Sorry for the long delay since your report! Cheers, Brian On Sat May 01 11:05:28 2010, sergstesh wrote: Show quoted text
> Hello, > > looking at > > http://search.cpan.org/~brianski/Audio-Wav-0.11/Wav/Write.pm > > I see: > > my $max_no = ( 2 ** $bits_sample ) / 2; > . > > Well, it should really be > > my $max_no = ( 2 ** $bits_sample ) / 2 - 1; > > - this is because for, say, 16 bit WAV file/signed integer the range
is Show quoted text
> -32768 .. 32767, so that '32767' rather than 32768 is the reason for > subtracting 1. > > Thanks, > Sergei. > > >