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 ( )
#Delay time before starting the source after the Transport has started.
this
Sync the source to the Transport so that when the transport is started, this source is started and when the transport is stopped or paused, so is the source.
EXAMPLE
//sync the source to start 1 measure after the transport starts
source.sync("1m");
//start the transport. the source will start 1 measure later.
Tone.Transport.start();.unsync ( )
#this
Unsync the source to the Transport. See Tone.Source.sync