1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use Audio::FLAC::Header; my $flac = Audio::FLAC::Header->new("beispiel.flac"); my $info = $flac->info(); foreach (keys %$info) { print "$_: $info->{$_}\n"; } my $tags = $flac->tags(); foreach (keys %$tags) { print "$_: $tags->{$_}\n"; }
QuoteInformation stored in the main hash that relates to the file itself or is calculated from some of the information fields is keyed by:
trackLengthMinutes
...
print "$flac->{trackLengthMinutes}\n";
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#! /usr/bin/env perl use strict; use warnings; use Audio::FLAC::Header; my $file = shift or die "no file specified\n"; my $flac = Audio::FLAC::Header->new( $file ); my $info = $flac->info(); for my $k ( keys %$info ) { print "$k: $info->{$k}\n"; } print "--8<--\n"; my $tags = $flac->tags(); for my $k ( keys %$tags ) { print "$k: $tags->{$k}\n"; } print "--8<--\n"; # siehe Antwort von pq for my $k ( qw( trackLengthMinutes trackLengthSeconds bitRate fileSize ) ) { print "$k: ", $flac->{$k}, "\n"; }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$ perl t.pl 7041888513520_01_13_96kHz.flac
MD5CHECKSUM: 0da31b0d1090e1aef3e0a14e8d962e0c
MINIMUMBLOCKSIZE: 4096
BITSPERSAMPLE: 24
SAMPLERATE: 96000
NUMCHANNELS: 2
MAXIMUMFRAMESIZE: 16798
MAXIMUMBLOCKSIZE: 4096
MINIMUMFRAMESIZE: 8735
TOTALSAMPLES: 23416420
--8<--
TOTALDISCS: 1
DATE: 2004-2008
ARTIST: Tone Wik / Barokkanerne
ALBUM ARTIST: 2L artists
PERFORMER: 2L artists
COMMENT: 2L-RR1-SABD 20��08 2L (Lindberg Lyd), Norway
TOTALTRACKS: 19
DISCNUMBER: 1
TITLE: VIVALDI: Recitative and Aria from Cantata RV 679, "Che giova il sospirar, povero core"
ALBUM: 2L Audiophile Reference Recordings
TRACKNUMBER: 13
GENRE: Classical
VENDOR: reference libFLAC 1.2.1 20070917
COMPOSER: Antonio Vivaldi (1678-1741)
--8<--
trackLengthMinutes: 4
trackLengthSeconds: 3
bitRate: 2573090.53497942
fileSize: 78165907
my $variable = $flac->tags("ALBUM ARTIST");
1 2 3 4 5 6 7 8 9 10 11 12
my %info; for my $key ( qw( ALBUM ARTIST GENRE TITLE ) ) { $info{$key} = $flac->tags($key); } for my $key ( qw( trackLengthMinutes trackLengthSeconds bitRate fileSize ) ) { $info{$key} = $flac->{$key}; } use Data::Dumper; print Dumper \%info;
2013-01-18T17:21:56 KarlaCluftIch kann nicht sagen warum aber jetzt läuft es!
2013-01-14T23:08:53 KarlaCluftGuten Abend zusammen!
Ich möchte gerne mit Hilfe des Moduls "Audio::FLAC::Header" folgende Informationen aus einem Track bzw. Album herausbekommen:
ALBUM
ARTIST
TITLE
GENRE
TRACKNUMBER
trackLengthMinutes
trackLengthSeconds
bitRate
fileSize
Wenn ich nun aber das Script (...)
laufen lasse, bekomme ich nur die ersten Informationen (ALBUM, ARTIST, TITEL, GENRE und TRACKNUMBER).
LG Karla
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
MD5CHECKSUM: 1a7ee8c9bbef70a3066fe51f3e2788c3
NUMCHANNELS: 2
SAMPLERATE: 44100
MINIMUMBLOCKSIZE: 4096
TOTALSAMPLES: 7478184
BITSPERSAMPLE: 6
MINIMUMFRAMESIZE: 10170
MAXIMUMBLOCKSIZE: 268435463
Album: The X Tracks
Genre:
Tracknumber: 10
VENDOR: reference libFLAC 1.2.1 20070917
Date:
Artist: Andy Summers
Title: Ruby My Dear