KeenASR React Native Plugin (v2.2)
    Preparing search index...

    Module keenasr-react-native

    KeenASR React Native Plugin

    Offline speech recognition SDK for React Native, wrapping the native KeenASR SDK for iOS and Android.

    import KeenASR, { onFinalResponse, onPartialResult } from 'keenasr-react-native';

    // 1. Initialize the SDK
    await KeenASR.initialize('keenA1m-nnet3chain-en-us');

    // 2. Create a decoding graph
    await KeenASR.createDecodingGraphFromPhrases('myGraph', [
    'hello world', 'goodbye world',
    ]);

    // 3. Prepare for listening
    await KeenASR.prepareForListening('myGraph');

    // 4. Subscribe to results
    const unsub = onFinalResponse((response) => {
    console.log(response.asrResult.text);
    response.release();
    });

    // 5. Start listening
    await KeenASR.startListening();
    • ASR Bundle: Language model and acoustic model files required for recognition.
    • Decoding Graph: A compiled recognition grammar built from phrases. Must be created before recognition can start.
    • Recognizer Lifecycle: Initialize → Create Graph → Prepare → Listen → Process. See RecognizerState for the state machine.
    • Response Lifecycle: Responses hold native memory and must be released via release() when no longer needed.
    • VAD (Voice Activity Detection): Controls how the recognizer detects the start and end of speech. See VadParameter.
    • GoP (Goodness of Pronunciation): Phone-level pronunciation scoring. Enable via computeGoP: true in prepareForListening.

    Initialization

    initialize
    initializeWithPath
    teardown

    Decoding Graph

    createDecodingGraphFromPhrases
    createContextualDecodingGraphFromPhrases
    decodingGraphExists

    Listening

    prepareForListening
    prepareForListeningWithContextualDecodingGraph
    startListening
    stopListening
    getInputLevel

    Configuration

    getRecognizerState
    setVADParameter
    setLogLevel
    setEchoCancellation

    Events

    onFinalResponse
    onPartialResult
    onAudioInterruptStarted
    onAudioInterruptEnded

    Dashboard

    startDataUploader
    pauseUploader
    resumeUploader
    stopUploader

    Text Alignment

    TextAligner