mmir.env.media.WebspeechAudioInput.MicLevelsAnalysisStub
Extends
Members
-
inherited private_audioAnalyzerAnalyserNode
-
inherited private_audioContextAudioContext
-
-
inherited private_currentInputStreamLocalMediaStream
-
inherited private_getUserMediagetUserMedia()
-
-
inherited private_isAnalysisActive
-
internal flag: is/should mic-levels analysis be active?
-
inherited private_isAnalysisCanceled
-
internal flag: is/should mic-levels analysis be active?
-
inherited privateisMicLevelsEnabled
-
Switch for generally disabling "microphone-level changed" calculations (otherwise calculation becomes active/inactive depending on whether or not a listener is registered to event
MIC_CHANGED_EVT_NAME
)TODO make this configurable?...
-
inherited private,constantLEVEL_CHANGED_THRESHOLD
-
MIC-LEVELS: threshold for calculating level changes
-
inherited private,constantMIC_CHANGED_EVT_NAME
-
MIC-LEVELS: Name for the event that is emitted, when the input-mircophone's level change.
- Default Value:
- "miclevelchanged"
-
inherited private,constantMIC_MAX_NORM_VAL
-
MIC-LEVELS: the maximal value for level changes (used for normalizing change-values)
-
inherited privateMIC_MAX_VAL
-
MIC-LEVELS: the maximal value to occurs in the input data
FIXME verify / check if this is really the maximal possible value...
-
inherited private,constantMIC_NORMALIZATION_FACTOR
-
MIC-LEVELS: normalization factor for values: adjust value, so that is more similar to the results from the other input-modules
-
inherited private,constantMIC_QUERY_INTERVALL
-
MIC-LEVELS: time interval / pauses between calculating level changes
-
inherited privaterecording
-
state-flag that indicates, if the process (e.g. ASR, recording) is actually active right now, i.e. if analysis calculations should be done or not.
-
inherited private,constantSTREAM_STARTED_EVT_NAME
-
STREAM_STARTED: Name for the event that is emitted, when the audio input stream for analysis becomes available.
- Default Value:
- "webaudioinputstarted"
Methods
-
inherited private_startAudioAnalysis()
-
HELPER start-up mic-levels analysis (and fire events for registered listeners)
-
inherited private_startUserMedia(inputstream)
-
HELPER callback for getUserMedia: creates the microphone-levels-changed "analyzer" and fires mic-levels-changed events for registered listeners
Name Type Description inputstream
LocalMediaStream -
inherited private_stopAudioAnalysis()
-
HELPER stop mic-levels analysis
-
inherited private_updateMicLevelAnalysis()
-
HELPER determine whether to start/stop audio-analysis based on listeners getting added/removed on the MediaManager
-
Getter/Setter for ASR-/recording-active state. This function should be called with
true
when ASR starts and withfalse
when ASR stops. NOTE setting theactive
state allows the analyzer to start processing when a listener formiclevelchanged
is added while ASR/recording is already active (otherwise the processing would not start immediately, but when the ASR/recording is started the next time).Name Type Description active
Boolean optional if active
is provided, then the mic-level-analysis' (recording) active-state is set to this value.Returns:
Type Description Boolean the mic-level-analysis' (recording) active-state. If argument active
was supplied, then the return value will be the same as this input value. -
inherited privatecreateAudioContext()
-
-
Get/set the mic-level-analysis' enabled-state: If the analysis is disabled, then
start
will not active the analysis (and currently running analysis will be stopped). This function is getter and setter: if an argumentenable
is provided, then the mic-level-analysis' enabled-state will be set, before returning the current value of the enabled-state (if omitted, just the enabled-state will be returned)Name Type Description enable
Boolean optional OPTIONAL if enable
is provided, then the mic-level-analysis' enabled-state is set to this value.Returns:
Type Description Boolean the mic-level-analysis' enabled-state -
inherited privategetDb()
-
HELPER calculate the dezible value for PCM value
- Deprecated
- currently un-used
-
inherited privategetRms()
-
HELPER calculate the RMS value for list of audio values
- Deprecated
- currently un-used
-
inherited privatehasChanged()
-
HELPER determine if a value has change in comparison with a previous value (taking the LEVEL_CHANGED_THRESHOLD into account)
-
inherited privatenormalize()
-
HELPER normalize the levels-changed value to MIC_MAX_NORM_VAL
- Deprecated
- currently un-used
-
inherited start(audioInputData)
-
Start the audio analysis for generating "microphone levels changed" events. This functions should be called, when ASR is starting / receiving the audio audio stream. When the analysis has started, listeners of the
MediaManager
for eventmiclevelchanged
will get notified, when the mic-levels analysis detects changes in the microphone audio input levels.Name Type Description audioInputData
AudioInputData optional If provided, the analysis will use these audio input objects instead of creating its own audio-input via getUserMedia
. The AudioInputData object must have 2 properties: { inputSource: MediaStreamAudioSourceNode (HTML5 Web Audio API) audioContext: AudioContext (HTML5 Web Audio API) } If this argument is omitted, then the analysis will create its own audio input stream viagetUserMedia
-
Stops the audio analysis for "microphone levels changed" events. This functions should be called, when ASR has stopped / closed the audio input stream.