3

I have a few quick questions regarding the Web Audio API. I am developing in JavaScript (AngularJS).

A great demo app that I am using is at: https://webaudiodemos.appspot.com/AudioRecorder/index.html

Once I grant access to my audio microphone in my Chrome browser, using the Audio API, is there a way to:

  1. Mute and un-mute the microphone?
  2. Manually changing the microphone volume from JavaScript?
  3. An Audio API function returning a Boolean flag (or any object) letting me know if the microphone is inaccessible (not working)?

I have found a few links on StackOverflow, but they have not given me the key information that I can use for my need:

Community
  • 1
  • 1
Sonny K
  • 63
  • 8

1 Answers1

5

1) Just run the MediaStreamSource node through a Gain node, and set gain to 0 or 1 to mute or unmute.

2) Ditto. Just use the same gain node.

3) Not really - what do you mean by "not working"? If it's really not working, you'll never get the stream.

cwilso
  • 13,610
  • 1
  • 30
  • 35