alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.57k stars 1.06k forks source link

How to Recognize digits with this lib #1350

Closed altaf2892 closed 1 year ago

altaf2892 commented 1 year ago

below is the initial implementation

Example: if i speak 123456 so lib gives me result := one two three four five six, Example2: if i speak 2000(two thousands) so lib should give me result := 2000, Please help me to achieve my reqirement ` private fun setUpSpeechReorganization() { val rec = Recognizer(model, 16000.0f) // val rec = Recognizer(model, 16000f, "[\"one zero zero zero one\", " + "\"oh zero one two three four five six seven eight nine\", \"[unk]\"]")

    speechService = org.vosk.android.SpeechService(rec, 16000.0f)

}

private fun initModel() { StorageService.unpack(this, "model-en-us", "model", { model: Model -> this.model = model

    }) { exception: IOException ->
        Log.e("Speech Models", "Failed to unpack the model" + exception.message)
    }
}

`

nshmyrev commented 1 year ago

Same as #627