@Component({selector: 'my-cmp', template: `...`})
class MyComponent implements DoCheck {
ngDoCheck() {
// ...
}
}
https://angular.io/api/core/DoCheck
ngDoCheck() {
...
// mic ON / OFF
if (this.service_mic.isMic === true && !this.service_mic.stream && this.service_mic.isUserMedia === false) {
this.service_mic.on((source) => {
this.service_gain.connect(source);
});
} else if (this.service_mic.isMic === false && this.service_mic.stream) {
this.service_mic.off();
this.service_gain.disconnect(this.service_mic.source);
}
...