Customizing Components


Functions to customize the Invox Dictation SDK components. These allow you to connect the SDK events to your own UI elements.

CustomizeComponents

FunctionDescriptionParametersReturns
INVOX.CustomizeComponents(callback)Allows you to handle Invox Dictation feedback before the session starts.Functionvoid

Use this function to register your component handlers before logging in:

// 1. Prepare your handlers
function customizeFeedback() {
    INVOX.OnChangeProgressBar((msg, type) => updateProgressbar(msg.Percentage));
    INVOX.OnChangeStatusBar((msg) => showProgressStatus(msg));
    /* All your required customizations */
}

// 2. Apply customization (must be called before session starts)
INVOX.CustomizeComponents(customizeFeedback);

// 3. Login starts...

// 4. (Optional) Overwrite handlers after session starts
INVOX.OnChangeStatusBar((msg) => showSessionStatus(msg));

OnChangeProgressBar

FunctionDescriptionParametersReturns
INVOX.OnChangeProgressBar(callback)Sets a handler called when the progress bar state changes.Functionvoid

The callback receives a message object with a Percentage property (0–100):

INVOX.OnChangeProgressBar((msg, type) => {
    document.getElementById("my-progress").style.width = msg.Percentage + "%";
});

OnChangeStatusBar

FunctionDescriptionParametersReturns
INVOX.OnChangeStatusBar(callback)Sets a handler called when the status bar message changes.Functionvoid
INVOX.OnChangeStatusBar((msg) => {
    document.getElementById("my-status").textContent = msg;
});

OnChangeHypothesisViewer

FunctionDescriptionParametersReturns
INVOX.OnChangeHypothesisViewer(callback)Sets a handler called when a new hypothesis is received during dictation.Functionvoid
INVOX.OnChangeHypothesisViewer((hypothesis) => {
    document.getElementById("my-hypothesis").textContent = hypothesis;
});

OnChangeAudioLevelIndicator

FunctionDescriptionParametersReturns
INVOX.OnChangeAudioLevelIndicator(callback)Sets a handler called when the audio level changes.Functionvoid
INVOX.OnChangeAudioLevelIndicator((level) => {
    document.getElementById("my-vumeter").style.width = level + "%";
});

CustomizeProgressBar / CustomizeStatusBar / CustomizeHypothesisViewer

Additional customization functions for each component allow you to override the default rendering. See CustomizeProgressBar, CustomizeStatusBar, and CustomizeHypothesisViewer in the API reference for full details.