
from pydub import AudioSegment from pyaudio import PyAudio segment = AudioSegment.from_file('test.flac') PAIMON = PyAudio() stream = PAIMON.open(format=PAIMON.get_format_from_width(segment.sample_width), channels=segment.channels, rate=segment.frame_rate, output=True) for frame_index in range(int(segment.frame_count())): stream.write(segment.get_frame(frame_index)) 发现一些奇怪的问题: