about summary refs log tree commit homepage
path: root/lib/dtas/splitfx.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dtas/splitfx.rb')
-rw-r--r--lib/dtas/splitfx.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb
index c7eaf42..1150ee0 100644
--- a/lib/dtas/splitfx.rb
+++ b/lib/dtas/splitfx.rb
@@ -10,7 +10,8 @@ require 'tempfile'
 # Unlike the stuff for dtas-player, dtas-splitfx is fairly tied to sox
 # (but we may still pipe to ecasound or anything else)
 class DTAS::SplitFX # :nodoc:
-  CMD = 'sox "$INFILE" $COMMENTS $OUTFMT $OUTDST $TRIMFX $FX $RATEFX $DITHERFX'
+  CMD = 'sox "$INFILE" $COMMENTS $OUTFMT $OUTDST $TRIMFX $FX' \
+        ' $RATEFX $DITHERFX $STATS'
   include DTAS::Process
   attr_reader :infile, :env, :command
 
@@ -204,6 +205,7 @@ class DTAS::SplitFX # :nodoc:
     elsif outfmt.bits && outfmt.bits <= 16
       env["DITHERFX"] = "dither -s"
     end
+    env['STATS'] = 'stats' if opts[:stats]
     comments = Tempfile.new(%W(dtas-splitfx-#{t.comments["TRACKNUMBER"]} .txt))
     t.comments.each do |k,v|
       env[k] = v.to_s
@@ -290,6 +292,7 @@ class DTAS::SplitFX # :nodoc:
       t = T.new
       t.tbeg = @t2s.call(start_time)
       t.comments = @comments.dup
+      title.valid_encoding? or warn "#{title.inspect} encoding invalid"
       t.comments["TITLE"] = title
       t.env = @env.dup
 
@@ -395,7 +398,7 @@ class DTAS::SplitFX # :nodoc:
         @out.puts "DONE #{done[0].inspect}" if $DEBUG
         done[1].close!
       else
-        fails << [ t, status ]
+        fails << [ done[0], status ]
       end
     end