how to loop audio in js

Solutions on MaxInterview for how to loop audio in js by the best coders in the world

showing results for - "how to loop audio in js"
Azariah
16 Jan 2021
1myAudio = new Audio('someSound.ogg'); 
2if (typeof myAudio.loop == 'boolean')
3{
4    myAudio.loop = true;
5}
6else
7{
8    myAudio.addEventListener('ended', function() {
9        this.currentTime = 0;
10        this.play();
11    }, false);
12}
13myAudio.play();
queries leading to this page
js new audio play on loopaudio loop javascript codemake audio loop javascriptplay audio file 2bjs while loopjavascript play sound loopjow to loop an audio file in jssound play loopjavascript while true audio playjs play sound loopnew audio javascript loophow to make audio loop in javascripthow to loop audio javascript htmlaudio loop jshow to play an audio in do while loop javascriptloop through sounds javascriptjs autoplay loop audiojavascript audio play loophow to play audio in javascript in loopplay sound in loop javascriptaudio loop in javascriptjs play sound in loopaudio js play infinitejavascript new audio loopplay music browser js loopmyaudio addeventlistener 28 27ended 27 2c function 28 29 7b this currenttime 3d 0 3b this play 28 29 3b 7d 2c false 29 3bhow to loop audio in jsjs audio loopjavascript audio loophow loop audio of js audio functionjs autoplay looped audiohow to make an audio object repear in javascriptloop audio in jsloop an audio jsloop audio in javascripthow to loop an audio file in jqueryloop audio javascriptjs loop audioaudio loop in javascriptloop audio jshow to loop an audio java scriptfor loop to play audio javascriptjs vanilla audio looploop an audio javascriptnew audio js loopaudio loop javascriptjavascript play audio in loopfor loop for looping an audio file in javascriptloop adio element jsjs loop audio soundsound in js loopjs play audio loopsound in loop javascriptplay audio on a loop jshow to play a sound in js and loop ithow to make sound play on loop htmlstream audio with node js and flutterwhy is my audio file looping in javascriptjavascript loop audioplay audio in loop javascriptplay audio in a loop jshtml audio loop jsjavascript sound loopsound plays in a loop javascriptloop sound javascriptjs play audio on loopplay loop javascriptaudio in aplinejs loophow to loop audio in javascriptsong repeat javascripthow to play sound on a loop in javascriptjs loop soundfor loop js with audiohow to loop an audio with jshtml5 audio looploop audio htmlplay sound in javascript loop play audio with javascript loop 5cload and play sound loop html5website not playing sound audio loophow to do a continuos loop of sound using jshow to loop an audio file javascriptaudio js loopingloop sound in javascriptjs loop musicjavascript audio loop playaudio javascript loopplay audio on loop jshow to loop audio in javascript on clickjavascript repeat soundaudio play repeat javascriptaudio play loopplay loop audio javascripthow to loop audio in js