Class MicrophoneSourceNode
java.lang.Object
com.codename1.media.audio.AudioNode
com.codename1.media.audio.MicrophoneSourceNode
Live captured audio as a graph source, the Codename One counterpart of the
Web Audio MediaStreamAudioSourceNode for a microphone. Created by
BaseAudioContext.createMicrophoneSource(AudioBuffer) over the
AudioBuffer a recorder fills when it is built with
MediaRecorderBuilder.redirectToAudioBuffer(true).
The node outputs one or two channels, as the capture delivers them (a
capture with more keeps the first two), resampled to the context's rate.
It keeps its delay short: when the graph falls behind it drops the oldest
captured audio rather than fall further behind, and when capture stalls it
outputs silence. Call close() to detach it from the buffer.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops listening to the capture buffer; the node outputs silence after what it already received.The buffer this node reads.Methods inherited from class AudioNode
connect, connect, connect, connect, disconnect, disconnect, disconnect, disconnect, disconnect, getChannelCount, getChannelCountMode, getChannelInterpretation, getContext, getNumberOfInputs, getNumberOfOutputs, setChannelCount, setChannelCountMode, setChannelInterpretation
-
Method Details
-
getSource
The buffer this node reads.
Returns
the capture buffer
-
close
public void close()Stops listening to the capture buffer; the node outputs silence after what it already received. Recording itself is the recorder's to stop.
-