sample.py 文件源码

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

项目:synthesizer 作者: irmen 项目源码 文件源码
def speed(self, speed):
        """
        Changes the playback speed of the sample, without changing the sample rate.
        This will change the pitch and duration of the sound accordingly.
        The algorithm used is simple, and it will cause a loss of sound quality.
        """
        assert not self.__locked
        assert speed > 0
        if speed == 1.0:
            return self
        rate = self.samplerate
        self.__frames = audioop.ratecv(self.__frames, self.samplewidth, self.nchannels, int(self.samplerate*speed), rate, None)[0]
        self.__samplerate = rate
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号