diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-09-28 06:50:04 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-09-28 07:10:53 +0000 |
commit | 77cbb5e71e466749f4966ef0caca6a5077ad72c9 (patch) | |
tree | ab5112f6a538e9bab91b0bbe6d5b7c1bceb819b2 /lib/dtas/format.rb | |
parent | 2118e3aa78ebbd91b9d10ec524186820cbfa9c50 (diff) | |
download | dtas-77cbb5e71e466749f4966ef0caca6a5077ad72c9.tar.gz |
This may be used to avoid automatic: * resampling (rate) * down/upmixing (channel) * dither/truncation (bits) Using any bypass mode means we can no longer guarantee gapless playback for audio collections where rate, channel, or bits vary. This can however be useful when CPU usage is too high. This may also be useful in audio engineering situations.
Diffstat (limited to 'lib/dtas/format.rb')
-rw-r--r-- | lib/dtas/format.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dtas/format.rb b/lib/dtas/format.rb index e9da16f..223d9c0 100644 --- a/lib/dtas/format.rb +++ b/lib/dtas/format.rb @@ -81,6 +81,14 @@ class DTAS::Format # :nodoc: ivars_to_hash(SIVS) end + def ==(other) + a = to_hash + b = other.to_hash + a["bits"] ||= bits_per_sample + b["bits"] ||= other.bits_per_sample + a == b + end + # for the _decoded_ output def bits_per_sample return @bits if @bits |