where is the the porblem in audiowrite?

조회 수: 5 (최근 30일)
nour arab
nour arab 2019년 7월 8일
답변: nour arab 2019년 7월 9일
where is the the porblem in audiowrite?
srate=11025;
t=0:1/srate:1;
s=sin(2*pi*500*t)
sound(s,srate);
AUDIOWRITE('test.wav',s,srate)
  댓글 수: 5
nour arab
nour arab 2019년 7월 9일
Error using audiowrite
The value of 'Fs' is invalid. Expected input to be positive.
Error in audiowrite>parseInputs (line 226)
parse(p,filename, y, Fs, pvpairs{:});
Error in audiowrite (line 103)
props = parseInputs(filename, y, Fs, varargin);
Error in Untitled5m (line 5)
audiowrite('test.wav',s,t)
Guillaume
Guillaume 2019년 7월 9일
The code you show:
audiowrite('test.wav',s,srate)
The error you get says that it comes from:
audiowrite('test.wav',s,t)
How can we tell you what the problem is if you don't even show us the same code as the one that produces the error.
In any case, the error couldn't be more clear. You're passing a negative sampling rate which of course makes no sense.

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2019년 7월 9일
In the original question you write:
AUDIOWRITE('test.wav',s,srate)
In the comment you mention:
audiowrite('test.wav',s,t)
The error message tells you clearly, that the 3rd input is not a positive scalar value.

nour arab
nour arab 2019년 7월 9일
Thanks it works

카테고리

Help CenterFile Exchange에서 Signal Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by