librosa 加载与 scipy.io.wavfile 读取的区别 [英] Difference between load of librosa and read of scipy.io.wavfile
问题描述
我对librosa的load
函数和scipy.io.wavfile
的read
函数的区别有疑问.>
I have a question about the difference between the load
function of librosa and the read
function of scipy.io.wavfile
.
from scipy.io import wavfile
import librosa
fs, data = wavfile.read(name)
data, fs = librosa.load(name)
导入的语音文件是同一个文件.如果运行上面的代码,两个函数出来的数据的值是不一样的.我想知道为什么数据的值不同.
The imported voice file is the same file. If you run the code above, the values of the data come out of the two functions differently. I want to know why the value of the data is different.
推荐答案
将音频文件加载为浮点时间序列.
Load an audio file as a floating point time series.
音频将自动重新采样到给定的速率(默认 sr=22050).
Audio will be automatically resampled to the given rate (default sr=22050).
要保留文件的本机采样率,请使用 sr=None.
To preserve the native sampling rate of the file, use sr=None.
scipy.io.wavfile.read
不会自动对数据重新采样,如果文件中的样本是整数,则不会将其转换为浮点数.
scipy.io.wavfile.read
does not automatically resample the data, and the samples are not converted to floating point if they are integers in the file.
这篇关于librosa 加载与 scipy.io.wavfile 读取的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!