Force quitting sound(y)

조회 수: 2 (최근 30일)
Bolin
Bolin 2012년 1월 18일
Hello,
How can I force quit the sound function if I accidentally played a 44100 hz file with the default hz?
Control - C doesn't seem to work and the only way is through the ctrl-alt-del
Thanks in advance

채택된 답변

Walter Roberson
Walter Roberson 2012년 1월 18일
Yes, ctrl-alt-del if you are in MS Windows. control-c is not active until the hard-coded routine returns.
Might I suggest that the lesson here is not to use sound()? You can use http://www.mathworks.com/help/techdoc/ref/audioplayer.html
  댓글 수: 4
Walter Roberson
Walter Roberson 2012년 1월 18일
audioplayer has a "stop" method. sound() does not. If being able to cancel the playing is important, then sound() is out of the running.
Daniel Shub
Daniel Shub 2012년 1월 18일
For the current question I agree that the flexibility of audioplayer is beneficial. My reaction was to the "the lesson here is not to use sound()" which I read as suggesting audioplayer was always as good as or better than sound.

댓글을 달려면 로그인하십시오.

추가 답변 (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