The Audio Track Provider of the audio from microphone.
// @input Asset.AudioTrackAsset audioTrack // @input int sampleRate = 44100var control = script.audioTrack.control;if (control.isOfType("Provider.MicrophoneAudioProvider")) { control.start();}control.sampleRate = script.sampleRate;var audioFrame = new Float32Array(control.maxFrameSize);script.createEvent("UpdateEvent").bind(function (eventData) { var audioFrameShape = control.getAudioFrame(audioFrame); if (audioFrameShape.x == 0) { return; } // do something with data}) Copy
// @input Asset.AudioTrackAsset audioTrack // @input int sampleRate = 44100var control = script.audioTrack.control;if (control.isOfType("Provider.MicrophoneAudioProvider")) { control.start();}control.sampleRate = script.sampleRate;var audioFrame = new Float32Array(control.maxFrameSize);script.createEvent("UpdateEvent").bind(function (eventData) { var audioFrameShape = control.getAudioFrame(audioFrame); if (audioFrameShape.x == 0) { return; } // do something with data})
Readonly
The maximum frame size of the audio track asset.
Sample rate (samples per second) of the audio track asset.
Exposes User Data
Writes current frame audio data to the passed in Float32Array and returns its shape. The length of the array can't be more than maxFrameSize.
Float32Array
maxFrameSize
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
other
Start processing audio from microphone. Useful to avoid redundant processing.
Stop processing audio from microphone.
The Audio Track Provider of the audio from microphone.
Example