Playing wav/midi

9 ビュー (過去 30 日間)
Frank
Frank 2011 年 8 月 11 日
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 件)

Fangjun Jiang
Fangjun Jiang 2011 年 8 月 11 日
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 件のコメント
Daniel Shub
Daniel Shub 2011 年 8 月 11 日
Please accept your answer to your question if you are happy with it.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulation, Tuning, and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by