vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

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

Open smbika007 opened this issue 1 year ago • 7 comments

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

smbika007 avatar Aug 17 '22 18:08 smbika007

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.

nshmyrev avatar Aug 17 '22 18:08 nshmyrev

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

smbika007 avatar Aug 17 '22 18:08 smbika007

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

nshmyrev avatar Aug 17 '22 19:08 nshmyrev

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

JulienLecoq avatar Aug 21 '22 20:08 JulienLecoq

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 avatar Aug 21 '22 20:08 JulienLecoq

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:

  • /mfcc.conf at the root of the model, but it is placed in /conf/mfcc.conf
  • /final.ext.raw at the root of the model, but it does not exist in the model folder hierarchy
  • /mean.vec at the root of the model, but it does not exist in the model folder hierarchy
  • /transform.mat at the root of the model, but it does not exist in the model folder hierarchy

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.

JulienLecoq avatar Aug 21 '22 21:08 JulienLecoq

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.

nshmyrev avatar Aug 21 '22 21:08 nshmyrev