"PortAudio Error: Unanticipated host error".Audio output device has become unresponsive: 1024 sample(s) remain after timeout.

4 visualizaciones (últimos 30 días)
Hi all,
I Have a problem with the reproduction of a sound using startBackground.
After I run the script below, just SOMETIMES, the following error messages appear:
"Audio output device has become unresponsive: 1024 sample(s) remain after timeout."
"PortAudio Error: Unanticipated host error".
Do you know why sometimes the script works and sometimes doesn't?
Thanks a lot.
sound = audioread('sound_s2.wav');
s2 = daq.createSession('directSound'); %create session
d = daq.getDevices; %check and find devices
ID2 =d(1,4).ID; %this is the ID of the external sound card that I want to use
addAudioOutputChannel(s2,ID2,1:5) %open 5 channels
queueOutputData(s2,sound);
%s2.IsContinuous = true;
WaitSecs(5); %wait to let queue data
startBackground(s2)
WaitSecs(15); %play for 15 seconds
stop(s2);
  1 comentario
Andreas Georgiou
Andreas Georgiou el 19 de Jul. de 2022
I get a similar error when I use "sound(....)". I used sound in a loop and only got the error in the 3rd iteration of the loop. The actual error says...
Error using sound (line 79)
Device Error: Unanticipated host error
I can only think that the computer goes in standby and the device is not responding.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Audio I/O and Waveform Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by