Sha256: 886a6652049f70244ee83f9ce6cd44de22f193969da7f781f26060d141e268bc

Contents?: true

Size: 1.09 KB

Versions: 56

Compression:

Stored size: 1.09 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)
  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

56 entries across 56 versions & 1 rubygems

Version Path
format_parser-0.18.0 spec/parsers/aiff_parser_spec.rb
format_parser-0.17.0 spec/parsers/aiff_parser_spec.rb
format_parser-0.16.1 spec/parsers/aiff_parser_spec.rb
format_parser-0.16.0 spec/parsers/aiff_parser_spec.rb
format_parser-0.15.1 spec/parsers/aiff_parser_spec.rb
format_parser-0.15.0 spec/parsers/aiff_parser_spec.rb
format_parser-0.14.1 spec/parsers/aiff_parser_spec.rb
format_parser-0.14.0 spec/parsers/aiff_parser_spec.rb
format_parser-0.13.6 spec/parsers/aiff_parser_spec.rb
format_parser-0.13.5 spec/parsers/aiff_parser_spec.rb
format_parser-0.13.4 spec/parsers/aiff_parser_spec.rb
format_parser-0.13.3 spec/parsers/aiff_parser_spec.rb
format_parser-0.13.2 spec/parsers/aiff_parser_spec.rb
format_parser-0.13.1 spec/parsers/aiff_parser_spec.rb
format_parser-0.13.0 spec/parsers/aiff_parser_spec.rb
format_parser-0.12.4 spec/parsers/aiff_parser_spec.rb
format_parser-0.12.2 spec/parsers/aiff_parser_spec.rb
format_parser-0.12.1 spec/parsers/aiff_parser_spec.rb
format_parser-0.12.0 spec/parsers/aiff_parser_spec.rb
format_parser-0.11.0 spec/parsers/aiff_parser_spec.rb