0

I need to look this typing sound over and over again until my typing animation is done. I know I can use an audio editor to extend the sound but I just want to know if there is any way to do this with just html5 and javascript. I need to loop it a specific number of times then stop it.

Here is my code:

<audio autoplay>
<source src="sfx_typing.mp3" type="audio/mpeg">
<embed height="50" width="100" src="sfx_typing.mp3">
</audio>

Thanks in advance for any help.

This also should happen on page load with no delay and no plugins should be used in the audio playing.

2
  • <audio data-hops=5 onended="if(this.dataset.hops--) this.play()" autoplay > Commented May 27, 2014 at 23:29
  • Thanks dandavis, if you post it, I'll make it answer. Commented May 28, 2014 at 11:29

1 Answer 1

1

You can play() audio again in ended event handler.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.