Sha256: 51a3e8e475a88ae155c8337aa93a9940b78f77643afdc74b8fb29d4cbae64ccd

Contents?: true

Size: 368 Bytes

Versions: 9

Compression:

Stored size: 368 Bytes

Contents

#!/usr/bin/env ruby

require "coreaudio"

wav = CoreAudio::AudioFile.new("sample.wav", :read)

m4a = CoreAudio::AudioFile.new("sample.m4a", :write, :format => :m4a,
                               :rate => wav.rate,
                               :channels => wav.channels)

loop do
  buf = wav.read(1024)
  break if buf.nil?
  m4a.write(buf)
end

wav.close
m4a.close

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
coreaudio-0.0.12 examples/convert_wav_to_m4a.rb
coreaudio-0.0.11 examples/convert_wav_to_m4a.rb
coreaudio-0.0.10 examples/convert_wav_to_m4a.rb
coreaudio-0.0.9 examples/convert_wav_to_m4a.rb
coreaudio-0.0.8 examples/convert_wav_to_m4a.rb
coreaudio-0.0.7 examples/convert_wav_to_m4a.rb
coreaudio-0.0.6 examples/convert_wav_to_m4a.rb
coreaudio-0.0.5 examples/convert_wav_to_m4a.rb
coreaudio-0.0.4 examples/convert_wav_to_m4a.rb