sample.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:synthesizer 作者: irmen 项目源码 文件源码
def make_16bit(self, maximize_amplitude=True):
        """
        Convert to 16 bit sample width, usually by using a maximized amplification factor to
        scale into the full 16 bit range without clipping or overflow.
        This is used for example to downscale a 32 bits mixed sample back into 16 bit width.
        """
        assert not self.__locked
        assert self.samplewidth >= 2
        if maximize_amplitude:
            self.amplify_max()
        if self.samplewidth > 2:
            self.__frames = audioop.lin2lin(self.__frames, self.samplewidth, 2)
            self.__samplewidth = 2
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号