赞
踩
import wave
import os
import numpy as np
from pydub import AudioSegment
import matplotlib.pylab as plt
%matplotlib inline
wav_file = 'now.wav'
song = AudioSegment.from_mp3('music.mp3')
song.export(wav_file , format="wav")
#Z转成numpy
wav =np.frombuffer(AudioSegment.from_mp3(wav_path).raw_data, dtype="int16")
wav = wav.astype("float")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。