How to mute and unmute sound in Angular2?

Related searches

I have a sound in my Angular project, like this:

introInfo() { = '../assets/sound1.wav';;;

 feedbackInfo() { = '../assets/sound1.wav';;
   // auto-start;

And I would like to be able to mute all sounds. If I click the button in my template:

<img class="grow" id="mute" [src]='mute' (click)="muteF()"/>

How could I write my function muteF? I would like to mute if I click the button. If I click a second time, it must perform unmute.

This works for me

  muteF() {
    if ( !== 0) { = 0;
    } else { = 1;

Mute Video By Js, A substantial shift occurred in 2016 on the release of Angular 2 (and the dropping of the Muting/unmuting volume work independently from the volume control. How to mute and unmute sound in Angular2? Ask Question Asked 2 years, 6 months ago. Active 6 days ago. Viewed 1k times 5. 1. I have a sound in my Angular project

something like this probably (unless angular has audio-specific features, for example).

import { ElementRef, Inject, Injectable, ViewChild } from '@angular/core';

export class MyService {
  @ViewChild('audio') audio: ElementRef

  constructor(/* DOCUMENT would be an option too, from @angular/platform-browser - `@Inject(DOCUMENT) private document: any` */) {}
  introInfo() {

then in the template

<audio #audio></audio>

Mute and Unmute Yourself, Click the Mic or Phone icon at the very top of the toolbar. Your audio is currently connecting via Computer mode (mic and speakers). You are unmuted (and� Run the Sound Playback Troubleshooter at Settings > Update & Security > Troubleshoot. Go to Device Manager reached by right clicking the Start button, choose the Sound controller device, then Driver tab, choose Roll Back Driver if that's available, if not choose Uninstall button and restart PC to reinstall driver.

You can use muted property such as = true;

Works for video element as well.


Video muted attribute not working � Issue #23009 � angular/angular , I'm submitting a [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Feature request� How to Mute or Unmute on Zoom. Zoom is a software you can use on Mac or Windows, as well as a mobile app for Android and iOS phones/tablets. This wikiHow will teach you how to mute or unmute yourself as well as how to set up and use the

howler, muted: Boolean optional True to mute and false to unmute. id: Number optional The sound ID. If none is passed, all sounds in group are stopped. To mute all participants, tap "Mute All" in the bottom right hand corner, then tap the blue "Mute All" button to confirm the change. You can check the option to allow participants to unmute

How to mute/unmute sound using pywin32?, My searches lead me to the Pywin32 which should be able to mute/unmute the sound and detect its state (on Windows 10, using Python 3+). I found a way using � That will mute all the audio/sound coming from the website active in the tab until you unmute it. Consequently, this will (indirectly) mute everyone in the Google Meet call.

Mute All / Unmute All: Mute or unmute all participants currently in the meeting. Mute participants on entry: Automatically mute participants as they join the meeting. Play enter/exit chime: Play a sound when participants join and leave the meeting; Lock meeting: Don't allow other participants to join the meeting in progress.

  • Did you try setting the volume to 0? something like = 0;
  • Set to true however you like.
  • @RahulSingh I don't use player yet.. I don't know if I need player just for one function
  • @AnnaF you are looking for something like this, you can make use of viewchild or viewchildren to get the all audio element or elements and then add the muted property to them to true this will solve the problem i guess