Play sound in Angular 4

前端 未结 7 1315
暗喜
暗喜 2020-12-12 22:17

I\'m working on an Electron app with Angular 4. I want to play sound on some specific action. Is there any module or code for that? It can be in the angular 4 o

相关标签:
7条回答
  • 2020-12-12 23:05

    step 1 npm install --save howler

    step 2 import Howl from howler in component

    step3 : inside the functional block add below code

             let sound = new Howl({
              src: ['sound.mp3']
                });
    
             sound.play()
    
    0 讨论(0)
提交回复
热议问题