MP3::Tag::Cue(3pm)

πŸ“¦
version 1.16 Β· 2 versions
  • 1.16 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.13 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

MP3::Tag::Cue β€” bestie, it's the module that parses .cue files. That's the whole job description. πŸŽ€


✨ SYNOPSIS ✨

okay so here's the vibe, literally just:

my $db = MP3::Tag::Cue->new($filename, $track);       # Name of audio file
my $db = MP3::Tag::Cue->new_from($record, $track); # Contents of .cue file

($title, $artist, $album, $year, $comment, $track) = $db->parse();

and then, go see MP3::Tag for the rest 🫢


🌸 DESCRIPTION 🌸

MP3::Tag::Cue is designed to be called from the MP3::Tag module, no cap. It parses the content of a .cue file. Simple. Elegant. Iconic.

So the .cue file gets looked for in the same directory as the audio file, and one of these conditions has to be satisfied for the match to happen:

  • The "audio" file specified is actually a .cue file;
  • There is exactly one .cue file in the directory of the audio file;
  • There is exactly one .cue file in the directory of the audio file with a basename which is a beginning of the name of the audio file.
  • There is exactly one .cue file in the directory of the audio file with a basename which matches (case-insensitive) a beginning of the name of the audio file.

If no .cue file is found in the directory of the audio file, the same process gets repeated once one directory uplevel, with the name of the file's directory used instead of the file name. E.g., with the files like this:

Foo/bar.cue
Foo/bar/04.wav

the audio file Foo/bar/04.wav will be associated with Foo/bar.cue. periodt πŸ’…

πŸŽ€ parse() πŸŽ€

($title, $artist, $album, $year, $comment, $track) =
   $db->parse($what);

parse_filename() extracts information about artist, title, track number, album and year from the .cue file. $what is optional btw β€” it maybe title, track, artist, album, year, genre or comment. If $what is defined, parse() will return only this element. just the one. nothing else. πŸ™ˆ

Additionally, $what can take the values "artist_collection" (returns the value of artist in the whole-disk-info field "PERFORMER", "songwriter".

πŸ¦‹ title() πŸ¦‹

$title = $db->title();

Returns the title, obtained from the 'Tracktitle' entry of the file. 🌈

πŸ“ artist() πŸ“

$artist = $db->artist();

Returns the artist name, obtained from the 'Performer' or 'Albumperformer' entries (the first which is present) of the file.

πŸ‘‘ track() πŸ‘‘

$track = $db->track();

Returns the track number, stored during object creation, or queried from the parent. it's giving main character energy fr fr

⭐ year() ⭐

$year = $db->year();

Returns the year, obtained from the 'Year' entry of the file. (Often not present. 😭)

πŸ’œ album() πŸ’œ

$album = $db->album();

Returns the album name, obtained from the 'Albumtitle' entry of the file.

🧚 comment() 🧚

$comment = $db->comment();

Returns the 'REM COMMENT' entry of the file. (Often not present. 😭 again.)

πŸ”₯ genre() πŸ”₯

$genre = $db->genre($filename);

πŸ’€ POD ERRORS πŸ’€

not the docs having coding errors, bestie, I'm crying. 😭 Here's what happened, explained below:

Around line 131:

=over without closing =back

lowkey iconic that even the docs are a little chaotic. vibe check: passed. πŸ’…

perl v5.36.0 ✨ 2022-12-30 ✨ and it's User Contributed Perl Documentation β€” so like, mwah, that's the whole page, bestie, ily, go tag some mp3s πŸ«ΆπŸŽ€πŸ’–