class Mp3::Meta

Overview

Responsible for reading meta information about mpeg-frames and the length of an mp3.

Resources used:

http://www.multiweb.cz/twoinches/mp3inside.htm http://gabriel.mp3-tech.org/mp3infotag.html https://github.com/spreaker/node-mp3-header

Defined in:

id3/mp3/meta.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(size : Int64, tags : Id3::TaggedFile, first_frame : Mp3::Frame, xing_header : Nil | Mp3::XingHeader, duration : Time::Span | Nil, frame_count : Int32 | Nil) #

[View source]

Class Method Detail

def self.read(r : Reader, fast : Bool = true, max_scan : BinarySize = 400.kb) #

Reads meta-information of an mp3.

max_scan is used to specify how many byes into the file to scan for the first frame.

Calculating the exact duration of the mp3 can be slow because the whole file has to be read. So the default is to not calculate the exact duration (fast = true).

TODO move max_scan default to global config


[View source]

Instance Method Detail

def approximate_duration : Time::Span #

[View source]
def approximate_frame_count : Int32 #

[View source]
def duration : Time::Span | Nil #

[View source]
def first_frame : Frame #

[View source]
def frame_count : Int32 | Nil #

[View source]
def size : Int64 #

[View source]
def tags : Id3::TaggedFile #

[View source]
def to_s(io) #

[View source]
def xing_header : XingHeader | Nil #

[View source]