python将MP3转wave转成numpy
作者:互联网
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")
标签:song,python,matplotlib,MP3,file,wav,AudioSegment,numpy,mp3 来源: https://blog.51cto.com/u_15177056/2725347