How can I play audio file located in a certain path?

2 vues (au cours des 30 derniers jours)
goutham gumm
goutham gumm le 16 Avr 2018
Commenté : goutham gumm le 17 Avr 2018
I would like to know if there is a function in MATLAB in which you can play audio file located in a certain path on my computer. I would like to just pass the location of the audio file into the function and it should be able to play it. Is there any such function?

Réponse acceptée

Jan
Jan le 16 Avr 2018
Modifié(e) : Jan le 16 Avr 2018

No, there is not one command for this, but three:

[y, Fs] = audioread(filename)
info    = audioinfo(filename);
player  = audioplayer(Y, Fs, info.BitsPerSample);
player.playblocking();

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by