about summary refs log tree commit homepage
path: root/lib/dtas/source/sox.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-08-25 09:36:22 +0000
committerEric Wong <normalperson@yhbt.net>2013-08-25 09:36:22 +0000
commit157b75aa71bb2d9e7140cd72f29451fa234a902a (patch)
treedd6c29146acbef5a0d8e4322507fc4b6ef5fd0f1 /lib/dtas/source/sox.rb
parent68ffa097e187da663fa3f537b430428ea5e8de2e (diff)
downloaddtas-157b75aa71bb2d9e7140cd72f29451fa234a902a.tar.gz
We'll be supporting reading the format from avprobe and ffprobe,
so we should avoid tying ourselves to soxi
Diffstat (limited to 'lib/dtas/source/sox.rb')
-rw-r--r--lib/dtas/source/sox.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/dtas/source/sox.rb b/lib/dtas/source/sox.rb
index 44b5f17..64ce095 100644
--- a/lib/dtas/source/sox.rb
+++ b/lib/dtas/source/sox.rb
@@ -36,7 +36,10 @@ class DTAS::Source::Sox # :nodoc:
   def format
     @format ||= begin
       fmt = DTAS::Format.new
-      fmt.from_file(@infile)
+      path = @infile
+      fmt.channels = qx(%W(soxi -c #{path})).to_i
+      fmt.type = qx(%W(soxi -t #{path})).strip
+      fmt.rate = qx(%W(soxi -r #{path})).to_i
       fmt.bits ||= precision
       fmt
     end