Tone.Microphone
↳ EXTENDS Tone.ExternalInputOpens up the default source (typically the microphone).
CONSTRUCTOR
new Tone.Microphone ( )EXAMPLE
//mic will feedback if played through master
var mic = new Tone.Microphone();
mic.open(function(){
//start the mic at ten seconds
mic.start(10);
});
//stop the mic
mic.stop(20);Members
.mute
↝ boolean #Mute the output.
EXAMPLE
//mute the output
source.mute = true;.state
↝ Tone.State READONLY #Returns the playback state of the source, either “started” or “stopped”.
.volume
↝ Decibels #The volume of the output in decibels.
EXAMPLE
source.volume.value = -6;Methods
.close ( )
#this
Close the media stream
.open ( )
#The callback function to execute when the stream is open
The callback function to execute when the media stream can’t open. This is fired either because the browser doesn’t support the media stream, or the user blocked opening the microphone.
this
Open the media stream
.start ( )
#When the source should be started.
this
Start the source at the specified time. If no time is given, start the source now.
EXAMPLE
source.start("+0.5"); //starts the source 0.5 seconds from now.stop ( )
#When the source should be stopped.
this
Stop the source at the specified time. If no time is given, stop the source now.
EXAMPLE
source.stop(); // stops the source immediately.sync ( )
#this
Sync the source to the Transport so that all subsequent calls to start and stop are synced to the TransportTime instead of the AudioContext time.
EXAMPLE
//sync the source so that it plays between 0 and 0.3 on the Transport's timeline
source.sync().start(0).stop(0.3);
//start the transport.
Tone.Transport.start();
EXAMPLE
//start the transport with an offset and the sync'ed sources
//will start in the correct position
source.sync().start(0.1);
//the source will be invoked with an offset of 0.4
Tone.Transport.start("+0.5", 0.5);.unsync ( )
#this
Unsync the source to the Transport. See Tone.Source.sync