Skip Menu |
 

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

Report information
The Basics
Id: 53199
Status: rejected
Priority: 0/
Queue: Audio-Scan

People
Owner: Nobody in particular
Requestors: mjmorrison [...] gmail.com
Cc:
AdminCc:

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



Subject: Missing vbr & id3_version
Date: Mon, 28 Dec 2009 22:26:35 -0500
To: bug-Audio-Scan [...] rt.cpan.org
From: Michael Morrison <mjmorrison [...] gmail.com>
Download (untitled) / with headers
text/plain 1.6k
Hi Andy, I am sending you this email on the suggestion of Dan Sully who recommended Audio::Scan over MP3::Info. First, let me say I am no great hand at Perl so it is very possible that Audio::Scan is working as expected but I am failing to use it properly. Having said that, I am not getting either VBR or id3_version info in the output of my test script using Audio::Scan. Here is my test script: #!/opt/local/bin/perl -wls use Audio::Scan; use File::Find; my @dirs = @ARGV; # look for files in each directory find(\&displayMP3Info, @dirs); sub displayMP3Info { # if the file has an MP3 extension if (/\.mp3$/) { # Just file info my $data = Audio::Scan->scan($_); # Just file info my $info = Audio::Scan->scan_info($_); # Just tags my $tags = Audio::Scan->scan_tags($_); for my $k1 ( sort keys %$info ) { print "$k1\n"; for my $k2 ( sort keys %{$info->{ $k1 }} ) { print "\t$k2\n"; for my $k3 ( sort keys %{$info->{ $k1 }->{ $k2 }} ) { print "\t\t$k3 => $info->{ $k1 }->{ $k2 }->{ $k3 }\n"; } } } } } The output is: The input is a directory with one mp3 file in it (I can send that file if you would like). sh-3.2# ./test.pl /Users/michael/Downloads/Applications/CASEY_CRIME_PHOTOGRAPHER/TEST/ info audio_offset audio_size bitrate file_size layer padding samplerate samples_per_frame song_length_ms stereo As you see... no vbr or id3_version Am I missing something? Thanks for your work for the Perl community! Yours, Michael Morrison
Hi,

First off, let me say that you should use Data::Dump to dump the contents of the Audio::Scan return data, manually going through the keys like that is tedious:

use Data::Dump qw(dump);
my $s = Audio::Scan->scan($file);
warn dump($s);

You may find the values you're looking for once you view the data this way.  If not, please send me a copy of your file and the Data::Dump output.

Here's some sample output from the info hash of one of my VBR files:

  info => {
            audio_offset             => 29854,
            audio_size               => 13763358,
            bitrate                  => 230000,
            file_size                => 13793340,
            id3_version              => "ID3v2.4.0, ID3v1.1",
            lame_encoder_delay       => 576,
            lame_encoder_padding     => 2240,
            lame_encoder_version     => "LAME3.97 ",
            lame_lowpass             => 19500,
            lame_noise_shaping       => 1,
            lame_preset              => "V0",
            "lame_replay_gain_radio" => "-0.8 dB",
            lame_source_freq         => "44.1 kHz",
            lame_stereo_mode         => "Joint",
            lame_surround            => "None",
            lame_tag_revision        => 0,
            lame_unwise_settings     => 0,
            lame_vbr_method          => "Variable Bitrate method1 (old/rh)",
            layer                    => 3,
            padding                  => 0,
            samplerate               => 44100,
            samples_per_frame        => 1152,
            song_length_ms           => 477466,
            stereo                   => 1,
            vbr                      => 1,
            xing_bytes               => 13763358,
            xing_frames              => 18278,
            xing_quality             => 97,
            xing_toc                 => [
                                          *snip*
                                        ],
          },
 
 
Subject: Re: [rt.cpan.org #53199] Missing vbr & id3_version
Date: Tue, 29 Dec 2009 12:28:03 -0500
To: bug-Audio-Scan [...] rt.cpan.org
From: Michael Morrison <mjmorrison [...] gmail.com>
Download (untitled) / with headers
text/plain 3.7k
Tedious is not the word... took me three days to figure out how to print out a hash of hashes. Data::Dump works just fine, thank you. Is VBR like Stereo in that it displays either a 0 or 1 or does it display nothing if it is a constant bit rate file? Also, I am getting this error on files with artwork: Modification of non-creatable hash value attempted, subscript "TIT1" at /opt/local/lib/perl5/site_perl/5.10.1/Data/Dump.pm line 272. I went back to your documentation and tried local $ENV{AUDIO_SCAN_NO_ARTWORK} = 1; in my script but to no avail. I've put two test files up at http://www.platodog.com/ since they are over 20meg each. Here is the script as it now stands: ########################## current test.pl ########################## #!/opt/local/bin/perl -wls use Audio::Scan; use File::Find; use Data::Dump qw(dump); my @dirs = @ARGV; find(\&displayMP3Info, @dirs); sub displayMP3Info { if (/\.mp3$/) { local $ENV{AUDIO_SCAN_NO_ARTWORK} = 1; my $s = Audio::Scan->scan($_); warn dump($s); } } ########################## current test.pl ########################## Here is the dump of two files, one with no tags and one with. sh-3.2# ./test.pl /Users/michael/Music/Old/TEST/ { info => { audio_offset => 0, audio_size => 24668786, bitrate => 128000, file_size => 24668786, layer => 3, padding => 1, samplerate => 44100, samples_per_frame => 1152, song_length_ms => 1541799, stereo => 0, }, tags => {}, } at ./test.pl line 24. { info => { audio_offset => 512, audio_size => 28810763, bitrate => 128000, file_size => 28811403, id3_version => "ID3v2.2.0, ID3v1", layer => 3, padding => 1, samplerate => 44100, samples_per_frame => 1152, song_length_ms => 1800672, stereo => 0, }, tags => { TALB => "album tag", TCOM => "composer tag", TCON => "Acid Punk", TDRC => 0, TIT2 => "title tab", TPE1 => "artist tag", }, } at ./test.pl line 24. Thanks again, Michael On Dec 28, 2009, at 10:37 PM, Andy Grundman via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=53199 > > > Hi, > > First off, let me say that you should use Data::Dump to dump the contents of > the Audio::Scan return data, manually going through the keys like that is > tedious: > > use Data::Dump qw(dump); > my $s = Audio::Scan->scan($file);warn dump($s); > > You may find the values you're looking for once you view the data this way. If > not, please send me a copy of your file and the Data::Dump output. > > Here's some sample output from the info hash of one of my VBR files: > > info => { audio_offset => 29854, > audio_size => 13763358, > bitrate => 230000, > file_size => 13793340, > id3_version => "ID3v2.4.0, ID3v1.1", > lame_encoder_delay=> 576, > lame_encoder_padding => 2240, > lame_encoder_version => "LAME3.97 ", > lame_lowpass => 19500, > lame_noise_shaping => 1, lame_preset => "V0", > "lame_replay_gain_radio" => "-0.8 dB", > lame_source_freq => "44.1 kHz", > lame_stereo_mode => "Joint", > lame_surround => "None", > lame_tag_revision => 0, > lame_unwise_settings => 0, > lame_vbr_method => "Variable Bitrate method1(old/rh)", > layer => 3, > padding => 0, > samplerate => 44100, > samples_per_frame =>1152, > song_length_ms => 477466, > stereo => 1, > vbr => 1, > xing_bytes => 13763358, > xing_frames => 18278, > xing_quality => 97, xing_toc => [ *snip* ], }, >
Subject: Re: [rt.cpan.org #53199] Missing vbr & id3_version
Date: Tue, 29 Dec 2009 12:39:46 -0500
To: bug-Audio-Scan [...] rt.cpan.org
From: Andy Grundman <andy [...] hybridized.org>
Download (untitled) / with headers
text/plain 784b
On Dec 29, 2009, at 12:28 PM, Michael Morrison via RT wrote: Show quoted text
> Is VBR like Stereo in that it displays either a 0 or 1 or does it display nothing if it is a constant bit rate file?
You are correct that vbr is only listed if the file is VBR. In your case both your files are CBR so it's not listed. Also it looks like id3_version is listed for your file that contains tags. So are you OK now, or is there still a bug? Show quoted text
> Also, I am getting this error on files with artwork: > Modification of non-creatable hash value attempted, subscript "TIT1" at /opt/local/lib/perl5/site_perl/5.10.1/Data/Dump.pm line 272.
I think that's a bug in Data::Dump, you can try Data::Dumper which would probably work. But using NO_ARTWORK is what I do as well to avoid dumping all that binary data.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.