sample.py 文件源码

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

项目:synthesizer 作者: irmen 项目源码 文件源码
def amplify_max(self):
        """Amplify the sample to maximum volume without clipping or overflow happening."""
        assert not self.__locked
        max_amp = audioop.max(self.__frames, self.samplewidth)
        max_target = 2 ** (8 * self.samplewidth - 1) - 2
        if max_amp > 0:
            factor = max_target/max_amp
            self.__frames = audioop.mul(self.__frames, self.samplewidth, factor)
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号