Exemplo n.º 1
0
    void Start()
    {
        _pocketSphinx.SetAcousticModelPath("en-us-ptm");
        _pocketSphinx.SetDictionaryPath("cmudict-en-us.dict");
        _pocketSphinx.SetKeywordThreshold(0.1f);
        _pocketSphinx.AddBoolean("-allphone_ci", true);

        _pocketSphinx.AddKeywordSearchPath(KWS_SEARCH, "menu.gram");
        _pocketSphinx.SetupRecognizer();
    }
Exemplo n.º 2
0
    public void SetUp(List <string> paths)
    {
        if (paths == null || paths.Count == 0)
        {
            return;
        }

        _pocketSphinx.SetAcousticModelPath("en-us-ptm");
        _pocketSphinx.SetDictionaryPath("cmudict-en-us.dict");
        _pocketSphinx.SetKeywordThreshold(0.1f);
        _pocketSphinx.AddBoolean("-allphone_ci", true);

        //register paths from conversations
        for (int i = 0; i < paths.Count; i++)
        {
            _pocketSphinx.AddKeywordSearchPath(paths[i], paths[i] + ".gram");
        }

        currentSearchKey = paths[0];

        _pocketSphinx.SetupRecognizer();
    }
Exemplo n.º 3
0
    void Start()
    {
        _pocketSphinx.SetAcousticModelPath("en-us-ptm");
        //Debug.Log("[SpeechRecognizerDemo] " + Application.streamingAssetsPath + "cmudict-en-us.dict");
        _pocketSphinx.SetDictionaryPath("cmudict-en-us.dict");
        _pocketSphinx.SetKeywordThreshold(1e-45f);
        _pocketSphinx.AddBoolean("-allphone_ci", true);

        // These one are optional
        _pocketSphinx.AddGrammarSearchPath(MENU_SEARCH, "menu.gram");
        _pocketSphinx.AddGrammarSearchPath(DIGITS_SEARCH, "digits.gram");
        _pocketSphinx.AddNGramSearchPath(FORECAST_SEARCH, "weather.dmp");
        _pocketSphinx.AddAllPhoneSearchPath(PHONE_SEARCH, "en-phone.dmp");

        _pocketSphinx.SetupRecognizer();

        infoTextDict = new Dictionary <string, string>();
        infoTextDict.Add(KWS_SEARCH, progressTexts[0]);
        infoTextDict.Add(MENU_SEARCH, progressTexts[1]);
        infoTextDict.Add(DIGITS_SEARCH, progressTexts[2]);
        infoTextDict.Add(FORECAST_SEARCH, progressTexts[3]);
        infoTextDict.Add(PHONE_SEARCH, progressTexts[4]);
    }