diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-09-10 09:21:17 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-09-10 10:10:17 +0000 |
commit | 699a1217fbfa06b0cde58e4430a35825c384167f (patch) | |
tree | 1dba4fdcaf4f12f55456db95774218c6f918815a /lib/dtas/format.rb | |
parent | a910d2ce86fa2cee0bed31e801173a981330fac1 (diff) | |
download | dtas-699a1217fbfa06b0cde58e4430a35825c384167f.tar.gz |
These are common output targets, at least for my workflow.
Diffstat (limited to 'lib/dtas/format.rb')
-rw-r--r-- | lib/dtas/format.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/dtas/format.rb b/lib/dtas/format.rb index 690a21f..e9da16f 100644 --- a/lib/dtas/format.rb +++ b/lib/dtas/format.rb @@ -59,6 +59,16 @@ class DTAS::Format # :nodoc: end end + # returns 1 or 0 depending on endianess + def endian_opusenc + case e = @endian || NATIVE_ENDIAN + when "big" then "1" + when "little" then "0" + else + raise"unsupported endian=#{e}" + end + end + def to_eca_arg %W(-f #{@type}_#{endian2},#@channels,#@rate) end @@ -92,6 +102,7 @@ class DTAS::Format # :nodoc: "SOXFMT" => to_sox_arg.join(' '), "ECAFMT" => to_eca_arg.join(' '), "ENDIAN2" => endian2, + "ENDIAN_OPUSENC" => endian_opusenc, } begin # don't set these if we can't get them, SOX_FILETYPE may be enough rv["BITS_PER_SAMPLE"] = bits_per_sample.to_s |