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.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/dtas/source/sox.rb b/lib/dtas/source/sox.rb
index e1baee9..eba53d4 100644
--- a/lib/dtas/source/sox.rb
+++ b/lib/dtas/source/sox.rb
@@ -22,8 +22,15 @@ class DTAS::Source::Sox # :nodoc:
 
   def try(infile, offset = nil)
     err = ""
-    qx(@env, %W(soxi #{infile}), err_str: err, no_raise: true)
+    cmd = %W(soxi -s #{infile})
+    s = qx(@env, cmd, err_str: err, no_raise: true)
     return if err =~ /soxi FAIL formats:/
+    case s
+    when %r{\A0\s*\z}
+      return warn "`#{Shellwords.join(cmd)}' detected zero samples"
+    when Process::Status
+      return warn "`#{Shellwords.join(cmd)}' failed with #{s.exitstatus}"
+    end
     source_file_dup(infile, offset)
   end