Subject: | File duration sometimes doubled for MP3s |
For a couple of MP3 files I have (recordings I made myself), Audio::File
reports twice the actual duration if I run:
my $info = Audio::File->new($file);
my $length = concise(duration($info->audio_properties->length()));
There's no particular distinguishing feature I can see: one of the files
is mono and one stereo, both recorded at 44.1kHz.
soxi reports the correct durations:
Input File : 'The Infanta's Birthday.mp3'
Channels : 1
Sample Rate : 44100
Precision : 16-bit
Duration : 00:42:27.38 = 112339546 samples = 191054 CDDA sectors
File Size : 25.6M
Bit Rate : 80.4k
Sample Encoding: MPEG audio (layer I, II or III)
Comments :
Title=Oscar Wilde / The Infanta's Birthday
Artist=Reuben Thomas
Year=2008
Input File : 'The Quest of Iranon.mp3'
Channels : 2
Sample Rate : 44100
Precision : 16-bit
Duration : 00:18:40.03 = 49393147 samples = 84002 CDDA sectors
File Size : 15.0M
Bit Rate : 107k
Sample Encoding: MPEG audio (layer I, II or III)
Comments :
Title=H. P. Lovecraft / The Quest of Iranon
Artist=Reuben Thomas
Year=2007
whereas File::Audio reports 5120s for the first and 2142s for the
second.