Playing wav/midi

Hi all. Is there a way to play wav and midi files in Matlab? I'm want to do something like:
%Generate a number from 1 to 3;
x = ceil(rand(1)*3);
switch x
case 1
??play('irish.mid')??
case 1
??play('beep.wav')??
case 1
??play('splash.wav')??
end

回答(2 个)

Does this give you an idea?
system('C:\WINDOWS\system32\dllcache\wmplayer http://www.satelitemusical.net/mj-akon-hold-my-hand.wma')
or
m=wavread('toilet.wav');
sound(m);
or
beep
Frank
Frank 2011-8-11
Thanks, but I found the answer:
load ***.mat
sound(y, Fs)

1 个评论

Please accept your answer to your question if you are happy with it.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息

提问:

2011-8-11

Community Treasure Hunt

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

Start Hunting!

Translated by