I have a sound in my Angular project, for example:
introInfo() {
this.audio.src = '../assets/sound1.wav';
this.audio.load();
this.audio.play();
}
feedbackInfo() {
this.audio.src = '../assets/sound1.wav';
this.audio.load();
this.audio.play();
}
And I would like to turn off all sounds. If I click the button in the template:
<img class="grow" id="mute" [src]='mute' (click)="muteF()"/>
How could I write my function muteF? I would like to mute if I press a button. If I click a second time, it should execute unmute.
source
share