Error using sound function
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Audio I/O and Waveform Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!