soundsc

조회 수: 6 (최근 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 CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by