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

SpeakerModel on Android #1602

Closed andreystarenky closed 3 days ago

andreystarenky commented 3 days ago

Hi, how do I unpack the SpeakerModel on Android? The StorageService.unpack() method (used for the regular model) returns a Model not SpeakerModel object.

Is there any documentation or examples for this? The vosk-android-demo doesn't implement the SpeakerModel anywhere that I can see.

andreystarenky commented 3 days ago

I made a method to unpack SpeakerModel, and it looks like it worked. But when I pass the SpeakerModel to the Recognizer object it doesn't return anything about speaker vector/signature in the hypothesis.

andreystarenky commented 3 days ago

I figured out the issue: when SetAlternatives(n) is used, it disables the SpeakerModel functionality. It also disables SetWords which is annoying but I am not sure if this is intentional or limited by kaldi model framework.

nshmyrev commented 3 days ago

It is good you figured things out. Overall speaker issues tracked in https://github.com/alphacep/vosk-api/issues/405