Sha256: a5c4216f3d30fc4641562eed262cb68317278e5c27b304cf0d8227932c71ee5d

Contents?: true

Size: 1.15 KB

Versions: 35

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe FormatParser::AIFFParser do
  it 'parses an AIFF sample file' do
    parse_result = subject.call(File.open(__dir__ + '/../fixtures/AIFF/fixture.aiff', 'rb'))

    expect(parse_result.nature).to eq(:audio)
    expect(parse_result.format).to eq(:aiff)
    expect(parse_result.media_duration_frames).to eq(46433)
    expect(parse_result.num_audio_channels).to eq(2)
    expect(parse_result.audio_sample_rate_hz).to be_within(0.01).of(44100)
    expect(parse_result.media_duration_seconds).to be_within(0.01).of(1.05)
    expect(parse_result.content_type).to eq('audio/x-aiff')
  end

  it 'parses a Logic Pro created AIFF sample file having a COMT chunk before a COMM chunk' do
    parse_result = subject.call(File.open(__dir__ + '/../fixtures/AIFF/fixture-logic-aiff.aif', 'rb'))

    expect(parse_result.nature).to eq(:audio)
    expect(parse_result.format).to eq(:aiff)
    expect(parse_result.media_duration_frames).to eq(302400)
    expect(parse_result.num_audio_channels).to eq(2)
    expect(parse_result.audio_sample_rate_hz).to be_within(0.01).of(44100)
    expect(parse_result.media_duration_seconds).to be_within(0.01).of(6.85)
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
format_parser-2.10.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.9.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.8.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.7.2 spec/parsers/aiff_parser_spec.rb
format_parser-2.7.1 spec/parsers/aiff_parser_spec.rb
format_parser-2.7.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.6.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.5.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.4.5 spec/parsers/aiff_parser_spec.rb
format_parser-2.4.4 spec/parsers/aiff_parser_spec.rb
format_parser-2.4.3 spec/parsers/aiff_parser_spec.rb
format_parser-2.3.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.2.1 spec/parsers/aiff_parser_spec.rb
format_parser-2.2.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.1.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.0.0 spec/parsers/aiff_parser_spec.rb
format_parser-2.0.0.pre.4 spec/parsers/aiff_parser_spec.rb
format_parser-2.0.0.pre.3 spec/parsers/aiff_parser_spec.rb
format_parser-2.0.0.pre.2 spec/parsers/aiff_parser_spec.rb
format_parser-2.0.0.pre spec/parsers/aiff_parser_spec.rb