How to play audio?

前端 未结 20 3226
抹茶落季
抹茶落季 2020-11-21 13:37

I am making a game with HTML5 and JavaScript.

How could I play game audio via JavaScript?

20条回答
  •  囚心锁ツ
    2020-11-21 13:45

    Just use this:

    
    

    Or, to make it simpler:

    
    

    Sample:

    Have NO IDEA if this works on other browsers other than Chrome 73!!

提交回复
热议问题