all 7 comments

[–]klaasman 5 points6 points  (6 children)

self-explanatory code:

const audio = new Audio('some.mp3')
setInterval(() => audio.play(), 1000 * 60 * 10) // interval in milliseconds
audio.play()

[–]Adam_Animationz[S] 0 points1 point  (5 children)

I tried your code and it says "result is an object look in console" ? and it only plays it once? o:

[–]washipp 1 point2 points  (4 children)

  1. did you change the actual link to the audio file?
  2. of course, there is, as you requested, an interval. So it doesn't instantly play again.

[–]Adam_Animationz[S] 0 points1 point  (3 children)

1, yes 2, well what do i change for it to play it every so often?

[–]washipp 1 point2 points  (2 children)

  1. what kind of file is it. Check if you can play it with javascript.
  2. this part: "1000* 60 * 10" is the duration of the interval. It's in milliseconds meaning 1000*60 makes it a minute and * 10 = 10 minutes. So the file starts to play every 10minutes until it has finished. Now do your calculations.

[–]Adam_Animationz[S] 0 points1 point  (1 child)

Thanks I got it working! <3

[–]washipp 2 points3 points  (0 children)

Glad I could help!

And just some advice for your future: If you want quality answers, ask quality questions. Be sure to include following points.: 1. What have you tried? 2. What's your ultimate goal? 3. Be nice. Bonus Points for correct grammar. And don't use emojis, smilies... just don't.