【发布时间】:2015-04-27 20:49:52
【问题描述】:
我正在尝试使用 Matlab 将音频文件拆分为 30 毫秒的不相交间隔。我目前有以下代码:
clear all
close all
% load the audio file and get its sampling rate
[y, fs] = audioread('JFK_ES156.wav');
for m = 1 : 6000
[t(m), fs] = audioread('JFK_ES156.wav', [(m*(0.03)*fs) ((m+1)*(0.03)*fs)]);
end
但问题是我收到以下错误:
In an assignment A(I) = B, the number of elements in B and I
must be the same.
Error in splitting (line 12)
[t(m), fs] = audioread('JFK_ES156.wav', [(m*(0.03)*fs)
((m+1)*(0.03)*fs)]);
我不明白为什么 B 和 I 中的元素数量不匹配以及如何解决这个问题。我怎样才能克服这个错误?还是有一种更简单的方法来分割音频文件(可能是我不知道的另一个功能或什么的)?
【问题讨论】:
标签: matlab audio frequency sampling