From 77cbb5e71e466749f4966ef0caca6a5077ad72c9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 28 Sep 2013 06:50:04 +0000 Subject: player: support bypass for rate, bits, channel 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. --- lib/dtas/format.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/dtas/format.rb') 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 -- cgit v1.2.3-24-ge0c7