about summary refs log tree commit homepage
path: root/lib/dtas/source/sox.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dtas/source/sox.rb')
-rw-r--r--lib/dtas/source/sox.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dtas/source/sox.rb b/lib/dtas/source/sox.rb
index 9d128a6..db1ace2 100644
--- a/lib/dtas/source/sox.rb
+++ b/lib/dtas/source/sox.rb
@@ -53,6 +53,10 @@ class DTAS::Source::Sox # :nodoc:
     @format ||= DTAS::Format.from_file(@env, @infile)
   end
 
+  def duration
+    samples / format.rate.to_f
+  end
+
   # This is the number of samples according to the samples in the source
   # file itself, not the decoded output
   def samples