Sha256: e5e5ad85ce1ad56c28291398764c8c045115b64f4fd3a553bd5e15a1c1ccb5d5

Contents?: true

Size: 368 Bytes

Versions: 1

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,
                               :channel => wav.channel)

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

wav.close
m4a.close

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coreaudio-0.0.3 examples/convert_wav_to_m4a.rb