lib/nu_wav.rb in nu_wav-0.2.0 vs lib/nu_wav.rb in nu_wav-0.3.0
- old
+ new
@@ -1,8 +1,12 @@
# http://www.prss.org/contentdepot/automation_specifications.cfm
# Bill Kelly <billk <at> cts.com> http://article.gmane.org/gmane.comp.lang.ruby.general/43110
+# BWF intro http://en.wikipedia.org/wiki/Broadcast_Wave_Format
+# BWF basics http://tech.ebu.ch/docs/tech/tech3285.pdf
+# BWF mpeg http://tech.ebu.ch/docs/tech/tech3285s1.pdf
+
require 'rubygems'
require 'mp3info'
require 'date'
module NuWav
@@ -176,11 +180,15 @@
wave.chunks[:fact] = fact
# NuWav::WaveFile.log "fact: #{fact}"
#mext chunk
mext = MextChunk.new
- mext.sound_information = 5
- mext.sound_information += 2 if mp3info.header[:padding]
+ # from what I can tell, a 7 indicates a homogenous 44100 or 22050 mpeg audio with no padding
+ mext.sound_information = 7
+
+ # from what I can tell, a 7 indicates a homogenous 44100 or 22050 mpeg audio with no padding
+ # if there is padding, it is more complicated, see sectin 2.2 here: http://tech.ebu.ch/docs/tech/tech3285s1.pdf
+ mext.sound_information = 5 if mp3info.header[:padding]
mext.frame_size = calculate_mpeg_frame_size(mp3info)
mext.ancillary_data_length = 0
mext.ancillary_data_def = 0
wave.chunks[:mext] = mext
# NuWav::WaveFile.log "mext: #{mext}"
\ No newline at end of file