def __init__(self, sound, start=0, end=None):
super(SoundThread, self).__init__()
self.wav_buffer = io.BytesIO()
_output = wave.open(self.wav_buffer, "wb")
_output.setnchannels(self.sound.channels)
_output.setsampwidth(self.sound.samplewidth)
_output.setframerate(self.sound.framerate)
_output.writeframes(self.sound.raw)
_output.close()
self.wav_buffer.seek(0)
评论列表
文章目录