Warning: Unable to play audio because no audio outputs were found.

398 views (last 30 days)
Anthony Birch
Anthony Birch on 10 Apr 2020
Commented: Van Cygnon Tango on 23 Oct 2021
Hey, I'm trying to play an mp3 file on MATLAB, but it's giving me this error: "Warning: Unable to play audio because no audio outputs were found."
This is my code:
[y,Fs] = audioread('Applause.mp3');
I'm not sure what I'm doing wrong...

Answers (1)

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi on 13 Apr 2020
Hello Anthony,
This error could be the result of the path being modified, or the necessary libraries being removed to access the sound components on the computer. To fix this, in the command window, use -
rehash toolboxcache
Further, evaluate if MATLAB is able to read the available outputs for audio on your PC using the function audiodevinfo. This results in a struct array containing all available & recognized audio inputs/outputs.
info = audiodevinfo
In case info returns an empty struct, it could be because of faulty drivers. Update all your drivers or disable devices one at a time and restart MATLAB and try 'audiodevinfo' to figure out if one or more devices has a possible faulty driver.
Instead, if info returns a struct with available outputs for audio (non-empty), you should be able to play the audio using audioplayer object. Additionally, if info has recognized multiple audio outputs, you can also use "device ID" to specify the output audio device.
Hope this helps!
  1 Comment
Van Cygnon Tango
Van Cygnon Tango on 23 Oct 2021
Hi Vinai,
I had the same problem as Anthony and it was cured thanks to your solution. You got my upvote!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!