How do i repeat an audio file?
10 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Walter Roberson
on 16 Nov 2018
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)
0 Comments
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!