weixin_45085938
weixin_45085938
采纳率100%
2020-12-16 12:49 阅读 52

matlab使用getaudiodata出错

function Wireless
COUNTER=2;
while COUNTER>0
Fs=8800;
flag=0;
Time_element=fix(100/9)/1000;
disp( 'waiting......' );
NN=4;
delay=Time_element*44*NN;
%%%%%%%%%%%%delayvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
pause(delay);
disp( 'now listen!' );
while (flag==0)
voice=audiorecorder(Fs,8,1);
recordblocking(voice,5);
voice = getaudiodata(voice);
plot(voice);
%voice=abs(voice);
if max(voice)*20>1 %%%%%%%%%%%%%%%%%%%%%
 flag=1;
end
end

上边是源代码,在做matlab通信原理的大作业,接收到声音后就会报错,错误如下,请问是什么原因啊,新手小白有很多地方不会,请见谅

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    bill20100829 歇歇 2020-12-16 14:04

    a=audiorecorder(8000,16,1);
    record(a);
    b=getaudiodata(a);

    你先找到错误函数。这行是输出错误。

    点赞 1 评论 复制链接分享

相关推荐