How do i repeat an audio file?

10 ビュー (過去 30 日間)
Vincenzo Catanza
Vincenzo Catanza 2018 年 11 月 15 日
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 日
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 日
Just use repmat to repeat the audiofile :)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by