def mono(self, left_factor=1.0, right_factor=1.0):
"""Make the sample mono (1-channel) applying the given left/right channel factors when downmixing"""
assert not self.__locked
if self.__nchannels == 1:
return self
if self.__nchannels == 2:
self.__frames = audioop.tomono(self.__frames, self.__samplewidth, left_factor, right_factor)
self.__nchannels = 1
return self
raise ValueError("sample must be stereo or mono already")
评论列表
文章目录