soundsc

5 ビュー (過去 30 日間)
Stephen
Stephen 2012 年 6 月 1 日
コメント済み: EkoSusatio 2015 年 9 月 22 日
So, I noticed that you can't cntr + c out of the sound playback from soundsc. Is there a way to kill the horrible noises I'm making? Thanks
  3 件のコメント
Kye Taylor
Kye Taylor 2012 年 6 月 1 日
Turn off your speakers :)
I'm also interested in how one might kill this process...
EkoSusatio
EkoSusatio 2015 年 9 月 22 日
Give clear all in command windows, the noises will stop

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

採用された回答

Daniel Shub
Daniel Shub 2012 年 6 月 1 日
The reason you cannot cancel the sound with crtl+c is that MATLAB plays the sound asynchronously. This means you can do other things while the sound is playing. If you want crtl+c to cancel the sound, you need to make SOUNDSC perform play blocking. If all you want is a way to stop the sound, then you need SOUNDSC to return a handle to the sound playing object. Both can be accomplished by deleting the PLAYSND mex file. This will force SOUNDSC to use an AUDIOPLAYER object. AUDIOPLAYER objects can be used to provide play blocking as well as provide a handle for stopping sound once playback has started.
If you also look at the source code for SOUNDSC you will see that it calls SOUND which calls PLAYSND. PLAYSND is either a mex (Windows) or an m file (Linux). The m file version uses AUDIOPLAYER, so it should be trivial to create your own playblocking version of SOUNDSC
  1 件のコメント
Stephen
Stephen 2012 年 6 月 2 日
thanks man

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by