|
Posted by Angus on June 23, 2006, 8:58 am
Please log in for more thread options
When I do a $cddb->lookup() twice in a row for the same disk, the
second lookup fails.
Short demo:
#!/usr/bin/perl -w
use strict;
use Audio::CD;
sub run_test {
my $device = shift;
my ($cd, $cddb, $data, $info, $cddb_t, $info_t, $i);
print "==== testing $device ", "="x40, "\n";
$cd = Audio::CD->init( $device );
$cddb = $cd->cddb();
$data = $cddb->lookup();
$info = $cd->stat();
$cddb_t = $data->tracks( $info );
$info_t = $info->tracks();
printf "Disk ID = %08x\n", $cddb->discid();
printf "Artist = %s\n", $data->artist();
printf "Album = %s\n", $data->title();
printf "Genre = %s\n", $data->genre();
printf "Tracks = %d\n", $info->total_tracks();
printf "Time = %2d:%02d\n", $info->time();
printf "Length = %2d:%02d\n", $info->length();
for ($i=0; $i<=$#; $i++) {
printf "%2d:%02d . %2d:%02d %s\n",
$[$i]->pos(),
$[$i]->length(),
$[$i]->name();
}
}
run_test( '/dev/cdrom' );
run_test( '/dev/cdrom' );
The second call to run_test() produces blank data from the lookup().
It seems as though the module calls cddb_generate_unknown_entry() for
some reason. Am I failing to reset the module somehow? I'd really
like a work-around for this problem. Anyone have any suggestions?
|
| Similar Threads | Posted | | RFC: Net::CIDR::Lookup | March 18, 2008, 1:19 pm |
| WWW::Authen::Simple table lookup | June 8, 2005, 1:20 am |
| "audio::wav" module | April 13, 2008, 8:35 am |
| Audio DSP Info needed | October 18, 2004, 11:00 pm |
| Audio::Data tarball seems incomplete | January 3, 2005, 4:06 pm |
| Audio DSP Usage in primitive sound cards | October 18, 2004, 4:55 am |
| Single API to read and edit MP3 and WMA audio files | April 29, 2005, 6:39 am |
| Error: RCPT TO: error (550 relay not permitted) | February 11, 2006, 1:39 pm |
| GD.c: 533: error: syntax error before "void" | March 24, 2006, 10:15 am |
| Error while using LWP | December 1, 2005, 8:06 am |
|