diff options
author | Eric Wong <e@80x24.org> | 2016-01-25 01:03:18 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-01-25 01:09:05 +0000 |
commit | 70b81da26a525486c288176e5764c875c752d0b8 (patch) | |
tree | ff451fe1efbdd3f1d76ec571c63e9045eab7e28e /lib/dtas/source/sox.rb | |
parent | 7bfed9258bfeae89bab5939be749d07592b9f49c (diff) | |
download | dtas-70b81da26a525486c288176e5764c875c752d0b8.tar.gz |
Almost, we will need to get a list of all suffixes supported by ffprobe or avprobe. This could prove tricky..
Diffstat (limited to 'lib/dtas/source/sox.rb')
-rw-r--r-- | lib/dtas/source/sox.rb | 4 |
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 |