GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
CD(3) User Contributed Perl Documentation CD(3)

Audio::CD - Perl interface to libcdaudio (cd + cddb)

  use Audio::CD ();
  my $cd = Audio::CD->init;

Audio::CD provides a Perl interface to libcdaudio by Tony Arcieri, available from http://cdcd.undergrid.net/

Several classes provide glue for the libcdaudio functions and data structures.

init
Initialize the Audio::CD object:

 my $cd = Audio::CD->init;
    
stat
Stat the Audio::CD object, returns an Audio::CD::Info object.

 my $info = $cd->stat;
    
cddb
Returns an Audio::CDDB object.

 my $cddb = $cd->cddb;
    
play
Play the given cd track (defaults to 1).

 $cd->play(1);
    
stop
Stop the cd.

 $cd->stop;
    
pause
Pause the cd.

 $cd->pause;
    
resume
Resume the cd.

 $cd->resume;
    
eject
Eject the cd.

 $cd->eject;
    
close
Close the cd tray.

 $cd->close;
    
play_frames
 $cd->play_frames($startframe, $endframe);
    
play_track_pos
 $cd->play_track_pos($strarttrack, $endtrack, $startpos);
    
play_track
 $cd->play_track($strarttrack, $endtrack);
    
track_advance
 $cd->track_advance($endtrack, $minutes, $seconds);
    
advance
 $cd->advance($minutes, $seconds);
    
get_volume
Returns an Audio::CD::Volume object.

 my $vol = $cd->get_volume;
    
set_volume
 $cd->set_volume($vol);
    

discid
 my $id = $cddb->discid;
    
lookup
Does a cddb lookup and returns an Audio::CD::Data object.

 my $data = $cddb->lookup;
    
Audio::CD::Data Class
artist
 my $artist = $data->artist;
    
title
 my $title = $data->title;
    
genre
 my $genre = $data->genre;
    
tracks
Returns an array reference of Audio::CD::Track objects.

name
 my $name = $track->name;
    

mode
Returns the CD mode, one of PLAYING, PAUSED, COMPLETED, NOSTATUS;

 my $track = $info->mode;
 print "playing" if $info->mode == Audio::CD::PLAYING;
    
total_tracks
Returns the total number of tracks on the cd.

 my $track = $info->total_tracks;
    
track_time
Returns the current track play time:

 my($minutes, $seconds) = $info->track_time;
    
time
Returns the current disc play time:

 my($minutes, $seconds) = $info->time;
    
length
Returns the disc length time:

 my($minutes, $seconds) = $info->length;
    
tracks
Returns an array reference of Audio::CD::Info::Track objects.

length
Returns the track length time:

 my($minutes, $seconds) = $tinfo->length;
    
pos
Returns the track position on the CD:

 my($minutes, $seconds) = $tinfo->pos;
    
type
Returns the track type (either TRACK_AUDIO or TRACK_DATA):

 if ($tinfo->type == Audio::CD::TRACK_AUDIO) {
   print "audio track\n";
 } elsif ($tinfo->type == Audio::CD::TRACK_DATA) {
   print "data track\n";
 }
    
is_audio
Returns true if the track is an audio track; equivalent to the test:

 $tinfo->type == Audio::CD::TRACK_AUDIO ? 1 : 0
    
is_data
Returns true if the track is a data track; equivalent to the test:

 $tinfo->type == Audio::CD::TRACK_DATA ? 1 : 0
    

Xmms(3)

Perl interface by Doug MacEachern

libcdaudio and cddb_lookup.c by Tony Arcieri

Hey! The above document had some coding errors, which are explained below:
Around line 139:
'=item' outside of any '=over'
Around line 161:
You forgot a '=back' before '=head1'
2000-04-10 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.