I am running a song through a while loop but once the song has finished its interval it doesn't keep repeating itself. Any help would be much appreciated!
a = true;
while(a == true)
play(song1)
end

답변 (2개)

Walter Roberson
Walter Roberson 2018년 11월 16일

1 개 추천

If song1 is an audioplayer object, then you can
while true
playblocking(song1);
end
But another approach with audioplayer objects would be to use
song1.StopFcn = @(src, event) play(src);
play(song1)
Frederik Bjørn Christensen
Frederik Bjørn Christensen 2021년 1월 6일

0 개 추천

Just use repmat to repeat the audiofile :)

카테고리

태그

질문:

2018년 11월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by