def __truediv__(self, other) -> Tuple['AudioSequence', 'AudioSequence']: if other != 2: raise ValueError("Can only split audio sequence in two tracks!") left, right = StereoDemuxer()(self.audio) if not list(right): right = left.copy() return self.new(left), self.new(right)
def to_stereo(audio: np.array) -> tuple: left, right = StereoDemuxer()(audio) if not [r for r in right if r != 0]: right = left.copy() return left, right