Error using sound function
이전 댓글 표시
I'm have an odd issue with a function I'm using for a Matlab App. I've been using this funciton for over a year without any issues and I have not changed it since originally writing it. However, I am now getting an error when I use Matlab 2022b. I get the error when I run the app using the App designer or running the App after the installation in the App tab of Matlab. However, I do not get this error on the same computer when I use Matlab 2020b. I also do not get this error when I install the App on other computers using Matlab 2022b. Does anyone know why this happening?
Thanks
The error:
Error using sound
Device Error: Invalid number of channels
The Function:
function playWarning()
%
persistent warningSoundY
persistent warningSoundFs
if isempty(warningSoundY)
addpath('Assets\Sounds\')
[ warningSoundY, warningSoundFs ] = audioread('chord.wav');
end
sound(warningSoundY, warningSoundFs)
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!