javascript - Changing src attribute of HTML5 audio element -
javascript - Changing src attribute of HTML5 audio element -
i trying utilize js playback sounds. want have piece of music playing after time replace sound file. thought effective way reuse same sound object, seems not kill original sound gets messy. best way this?
my code below, im doing passing in new source @ time
function ingamesndcreate(src) { ingamesnd = new audio(src) ingamesnd.loop = true; ingamesnd.play(); } thanks in advance
i expect you'll need alter source in dom using javascript. next should work.
document.getelementbyid('audio_id').src = 'different_file.wav'; javascript audio html5
Comments
Post a Comment