How can I interrupt the playback of an audio file that has been initiated using WAVPLAY in MATLAB 7.9 (R2009b)?

조회 수: 10 (최근 30일)
I have created a GUI application which starts the playback of an audio file using WAVPLAY. I would like to insert a new button in the GUI that allows the user to pause or stop the audio playback.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 11월 11일
There is no function in MATLAB that can pause or stop audio playback once initiated by WAVPLAY. Instead of using WAVPLAY, an alternative is to create an AUDIOPLAYER object. This type of object has methods which allow pausing, resuming and stopping the audio playback. For example:
player = audioplayer(Y, Fs)
% start the playback
play(player);
% pause the playback
pause(player);
% resume the playback
resume(player)
% stop the playback
stop(player)
For further details refer to the AUDIOPLAYER documentation.
doc audioplayer

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

제품


릴리스

R2009b

Community Treasure Hunt

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

Start Hunting!

Translated by