Can MATLAB's `sound` function be used without interfering with other programs' audio?
3 views (last 30 days)
Show older comments
An example of the issue: If on a meeting using the video chat program "Zoom", when this code runs in MATLAB
[y, Fs] = audioread('pathToAudioFile.wav');
sound(y, Fs);
it successfully plays the audio file, but makes Zoom become silent. Even after exiting MATLAB, Zoom remains silent. Audio in Zoom does not return until closing and reopening Zoom.
Can anyone (perhaps someone with more audio-driver experience than myself) explain why this might happen, and is there any way to address this issue?
A potentially helpful clue is that only some programs (like Zoom) are hindered by MATLAB's `sound` function. While troubleshooting, I played a YouTube video in Firefox and ran the same MATLAB code to see if it disrupted Firefox's audio, and though there was a momentary blip in the video's audio, it immediately came back to normal, and subsequent calls to `sound` had no effect on Firefox's audio.
Another clue is that not all audio-playing code disrupts Zoom. I used `winsound.PlaySound` in Python to play the same audio file as before, and Zoom's audio was unaffected. So there's something about the combination of MATLAB and another program which causes them to have an issue.
EDIT: Yet another possibly helpful detail, the same issue occurs when using `audioplayer()` instead of `sound`. Don't even need to call `player.play()`. Just using `audioplayer()` exhibits the issue.
0 Comments
Answers (0)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!