alphacep / vosk-api

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

Same issue as "Cannot open config file: model-spk/mfcc.conf" #1115

Open smbika007 opened 2 years ago

smbika007 commented 2 years ago

Hi,

1 - nuget for visual studio 2019 did NOT work. Kept telling me it couldn't find it when it was clearly there. I got around that by compiling for C#sharp (the command "mcs" was incorrect. I used "csc" which worked - call this issue #1.a)

2 - I downloaded and unpacked the model into a directory called "model-spk" (why not)

such that: model-spk ---am ---conf ---graph ---ivector

Is the folder/subfolder structure

3 - I ran the program using a fully qualified path to "model-spk"

I got: ERROR (VoskAPI:ReadConfigFile():parse-options.cc:462) Cannot open config file: model-spk/mfcc.conf

I then moved the 2 config files to the model-spk folder and got the same error.

So, where is the proper place for these files (if there, indeed, IS one) and why are they in the conf folder in the first place?

Thanks, Smbika

nshmyrev commented 2 years ago

ERROR (VoskAPI:ReadConfigFile():parse-options.cc:462) Cannot open config file: model-spk/mfcc.conf

This message suggests that you are using relative paths in your code. We suggest you to use absolute path in model constructor, it will find models then.

Take a note that speech recognition model and speaker model are two different models. Both are available on models page.

smbika007 commented 2 years ago

Thanks for the quick response.

This is the code in main for the demo:

    Model model = new Model("C:\\Users\\smbik\\Documents\\Vosk\\Model-spk");
    DemoBytes(model);
    DemoFloats(model);
    DemoSpeaker(model);

    I clearly specify the full path and I named the directory model-spk because of the error I got.

    I got the model from this page:

    https://alphacephei.com/vosk/models

    So I found 

Speaker identification model: vosk-model-spk-0.4

where should this go in relation to the speech recognition model and which path should I specify in the line:

Model model = new Model("C:\Users\smbik\Documents\Vosk\Model-spk");

Again, thanks - I'll eventually get to work as a co-worker did with Python

nshmyrev commented 2 years ago

The original code says Model constructor takes a folder with asr model, not speaker model:

https://github.com/alphacep/vosk-api/blob/master/csharp/demo/VoskDemo.cs#L75

spk model is for SpkModel class:

https://github.com/alphacep/vosk-api/blob/master/csharp/demo/VoskDemo.cs#L52

JulienLecoq commented 2 years ago

How does a speaker model differ from a "normal" model? There is no distinction here: https://alphacephei.com/vosk/models

JulienLecoq commented 2 years ago

Hi,

1 - nuget for visual studio 2019 did NOT work. Kept telling me it couldn't find it when it was clearly there. I got around that by compiling for C#sharp (the command "mcs" was incorrect. I used "csc" which worked - call this issue #1.a)

2 - I downloaded and unpacked the model into a directory called "model-spk" (why not) such that: model-spk ---am ---conf ---graph ---ivector

Is the folder/subfolder structure

3 - I ran the program using a fully qualified path to "model-spk"

I got: ERROR (VoskAPI:ReadConfigFile():parse-options.cc:462) Cannot open config file: model-spk/mfcc.conf

I then moved the 2 config files to the model-spk folder and got the same error.

So, where is the proper place for these files (if there, indeed, IS one) and why are they in the conf folder in the first place?

Thanks, Smbika

I have the same problem :/

JulienLecoq commented 2 years ago

The models seem to be all wrong on the website. According to: https://github.com/alphacep/vosk-api/blob/master/src/spk_model.cc, we should have:

Also, even if not related. Documentation on this topic (speaker identification) would be really helpful. Navigating between issues is not very easy and some info are still lacking. I can't wait to have speaker identification working to have a secure command system by voice implemented.

nshmyrev commented 2 years ago

Documentation on this topic (speaker identification) would be really helpful.

Sure! Write some basic draft following https://github.com/alphacep/vosk-api/issues/405 and we will be happy to finalize it.