Error in 'untitled/Audio Device Writer': A given audio device may only be opened once.
Afficher commentaires plus anciens
why do i get this error >>> Error in 'untitled/Audio Device Writer': A given audio device may only be opened once<<< while rinning my simlunk block that play a sound?
note that i run it before with no problems. however, now i got this error although i didn't put any changes!!!
Réponse acceptée
Plus de réponses (1)
Gabriele Bunkheila
le 3 Déc 2018
Modifié(e) : Gabriele Bunkheila
le 3 Déc 2018
Hi Fatima,
Please refer to the code in the example "Audio Stream from Device to Device" under " Quick Start Examples" in the page Real-Time Audio in MATLAB. In particular, the few lines of code below should do what you need:
% In the two lines of code below, provide any additional property value necessary to point the object to your sound card(s)
deviceReader = audioDeviceReader;
deviceWriter = audioDeviceWriter('SampleRate',deviceReader.SampleRate);
disp('Begin Signal Input...')
tic
while toc < 5
mySignal = deviceReader();
% Process mySignal as needed
deviceWriter(mySignal);
end
disp('End Signal Input')
release(deviceReader)
release(deviceWriter)
Regards,
Gabriele.
1 commentaire
fatima alansari
le 6 Déc 2018
Catégories
En savoir plus sur Code Generation and Deployment dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!