Voice Recognition stops listening after a few seconds

前端 未结 5 1279
执笔经年
执笔经年 2020-11-29 01:20

I tried a lot but can´t find it out, so I hope you can help me.

I am trying to build my own voice recognition app, which doesn´t show up the dialog.

I alread

5条回答
  •  借酒劲吻你
    2020-11-29 02:00

    I had the same issue with the Node.js library and here is the issue I submitted along with the response from the team. https://github.com/googleapis/nodejs-speech/issues/667

    TLDR; Set your config as following (pay attention to use enhanced models)

     const config = {
            encoding: "LINEAR16",
            sampleRateHertz: 16000,
            languageCode: "en-US",
            metadata: recognitionMetadata,
            model: 'phone_call',
            useEnhanced: true}
    

    The output that you will get is the following - pay attention to alternatives, it's tad misleading wording in my opinion but oh well :

    [{"results":[{"alternatives":[{"words":[],"transcript":"I live in Boston","confidence":0.9128385782241821}],"channelTag":0,"languageCode":"en-us"},{"alternatives":[{"words":[],"transcript":" Boston is an amazing City","confidence":0.9128385186195374}],
    

提交回复
热议问题