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.36k stars 1.04k forks source link

Vosk Dependency did not integerate in android kotin why #1547

Open Tajammal39 opened 3 months ago

Tajammal39 commented 3 months ago
fun recognizeSpeech(recordedAudio: ByteArray): String {
    // Assuming VoskModel is a function to load the model from assets
    val model = VoskModel.loadModel("assets/final.mdl")

    // Check Vosk documentation for the appropriate recognizer constructor
    val recognizer = KaldiRecognizer(model, 16000)

    recognizer.SetPartialResults(true)
    val buffer = recognizer.AcceptWaveform(recordedAudio)

    val result = buffer ?: ""
    recognizer.FinalizeRecognition()
    return result
}

Added Dependency but i am facing the error implementation ("com.alphacep:vosk-android:0.3.12") Unresolved reference: VoskModel Unresolved reference: KaldiRecognizer