import waveimport osimport numpy as npfrom pydub import AudioSegmentimport matplotlib.pylab as plt%matplotlib inline wav_file = 'now.wav'song = AudioSegment.from_mp3('music.mp3')song.export(wav_file , format="wav")#Z转成numpywav =np.frombuffer(AudioSegment.from_mp3(wav_path).raw_data, dtype="int16")wav = wav.astype("float")