Matlab 音频播放器数组
我正在labview 中创建一个matlab 脚本。在该脚本中,我尝试创建音频播放器对象的数组。但是,我遇到了错误,并且找不到解决方法。
这是脚本:
nrOfSounds = 11;
if (exist('p') == 0)
[snd, freq, bps] = wavread('sounds/1.wav');
p = audioplayer(snd, freq);
for t=2:nrOfSounds
[snd,freq,bps] = wavread(strcat('sounds/',num2str(t),'.wav'));
s = audioplayer(snd,freq);
p(end+1) = s;
end
end
这就是错误:
Audioplayer objects cannot be concatenated.
似乎我无法创建音频播放器对象的数组,但我无法真正找到解决此问题的方法,因为我对 matlab 没有真正的经验。谁能帮我解决这个问题吗?
I am creating a matlab script inside labview. Inside that script I try to create an array of audioplayer objects. However, I got an error, and I can't find a way around it.
This is the script:
nrOfSounds = 11;
if (exist('p') == 0)
[snd, freq, bps] = wavread('sounds/1.wav');
p = audioplayer(snd, freq);
for t=2:nrOfSounds
[snd,freq,bps] = wavread(strcat('sounds/',num2str(t),'.wav'));
s = audioplayer(snd,freq);
p(end+1) = s;
end
end
And this is the error:
Audioplayer objects cannot be concatenated.
It seems that I can't create an array of audioplayer objects, but I can't really find a way around this since I'm not really experienced with matlab. Can anyone help me with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用单元格,而不是数组。
You have to use cells, not arrays.