1CDDB_get(3) User Contributed Perl Documentation CDDB_get(3)
2
3
4
6 CDDB - Read the CDDB entry for an audio CD in your drive
7
9 use CDDB_get qw( get_cddb );
10
11 my %config;
12
13 # following variables just need to be declared if different from defaults
14
15 $config{CDDB_HOST}="freedb.freedb.org"; # set cddb host
16 $config{CDDB_PORT}=8880; # set cddb port
17 $config{CDDB_MODE}="cddb"; # set cddb mode: cddb or http
18 $config{CD_DEVICE}="/dev/cdrom"; # set cd device
19
20 # user interaction welcome?
21
22 $config{input}=1; # 1: ask user if more than one possibility
23 # 0: no user interaction
24
25 # get it on
26
27 my %cd=get_cddb(\%config);
28
29 unless(defined $cd{title}) {
30 die "no cddb entry found";
31 }
32
33 # do somthing with the results
34
35 print "artist: $cd{artist}\n";
36 print "title: $cd{title}\n";
37 print "category: $cd{cat}\n";
38 print "cddbid: $cd{id}\n";
39 print "trackno: $cd{tno}\n";
40
41 my $n=1;
42 foreach my $i ( @{$cd{track}} ) {
43 print "track $n: $i\n";
44 $n++;
45 }
46
48 This module/script gets the CDDB info for an audio cd. You need LINUX,
49 SUNOS or *BSD, a cdrom drive and an active internet connection in order
50 to do that.
51
53 Run "perl Makefile.pl" as usual. ("make", "make install" next)
54
56 This library is released under the same conditions as Perl, that is,
57 either of the following:
58
59 a) the GNU General Public License Version 2 as published by the Free
60 Software Foundation,
61
62 b) the Artistic License.
63
64 This program is distributed in the hope that it will be useful, but
65 WITHOUT ANY WARRANTY; without even the implied warranty of
66 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
67 GNU General Public License or the Artistic License for more details.
68
69 You should have received a copy of the Artistic License with this Kit,
70 in the file named "Artistic". If not, I'll be glad to provide one.
71
72 You should also have received a copy of the GNU General Public License
73 along with this program, in the file names "Copying"; if not, write to
74 the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
75 MA 02111-1307, USA.
76
77 If you use this library in a commercial enterprise, you are invited,
78 but not required, to pay what you feel is a reasonable fee to the
79 author, who can be contacted at armin@xos.net
80
82 (c) 2003 Armin Obersteiner <armin(at)xos(dot)net>
83
85 perl(1), Linux: /usr/include/linux/cdrom.h, Solaris, *BSD:
86 /usr/include/sys/cdio.h.
87
88
89
90perl v5.32.1 2021-01-26 CDDB_get(3)