Sha256: d8363e07b6f8186572d62186deb8ef082c6b0771d2fa3fc10696a47f755b3d7e
Contents?: true
Size: 911 Bytes
Versions: 22
Compression:
Stored size: 911 Bytes
Contents
require_relative 'aac_parser/adts_header_info' class FormatParser::AACParser include FormatParser::IOUtils AAC_MIME_TYPE = 'audio/aac' def likely_match?(filename) filename =~ /\.aac$/i end def call(raw_io) io = FormatParser::IOConstraint.new(raw_io) header = safe_read(io, 9) header_bits = header.unpack('B*').first.split('') header_info = FormatParser::AdtsHeaderInfo.parse_adts_header(header_bits) return if header_info.nil? FormatParser::Audio.new( title: nil, album: nil, artist: nil, format: :aac, num_audio_channels: header_info.number_of_audio_channels, audio_sample_rate_hz: header_info.mpeg4_sampling_frequency, media_duration_seconds: nil, media_duration_frames: nil, intrinsics: nil, content_type: AAC_MIME_TYPE ) end FormatParser.register_parser new, natures: :audio, formats: :aac end
Version data entries
22 entries across 22 versions & 1 rubygems