MATLAB app designer not playing sounds
古いコメントを表示
I am trying to excute the following lines with MATLAB app designer
[x, fs] = audioread('wave.wav');
app.freq = 2 * fs;
player = audioplayer(x, app.freq);
play(player);
but no sound is produced. However, when I copy the above lines along with those lines,
restoredefaultpath
rehash toolboxcache
savepath
it sounds in the command window but not in the app designer.
How can I fix this issue? - TIA
採用された回答
その他の回答 (1 件)
Adham Elkhouly
2021 年 4 月 27 日
2 件のコメント
Subhadeep Koley
2021 年 4 月 27 日
@Adham Elkhouly I think, if you use sound(app.x, app.freq), then the audio clip will keep on playing even if you close the app window.
Whereas, using the below code, will stop the sound as soon as you close the app window.
app.player = audioplayer(app.x, app.freq);
play(app.player);
Adham Elkhouly
2021 年 4 月 27 日
カテゴリ
ヘルプ センター および File Exchange で Audio Plugin Creation and Hosting についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!