Is there a way to force Google Speech api to return only words as response?

前端 未结 2 793
天命终不由人
天命终不由人 2021-02-05 10:20

I am using Googles this api :-

https://www.google.com/speech-api/v2/recognize?output=json&lang=\"+ language_code+\"&key=\"My key\"

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 10:25

    Take a look at this question and answer.

    You can give the API "speech context" hints, like this:

    "speech_context": {
      "phrases":["zero", "one", "two", ... "nine", "ten", "eleven", ... "twenty", "thirty,..., "ninety"]
     }
    

    I imagine this could work for other languages too, like German.

    "speech_context": {
      "phrases":["eins", "zwei", "drei", ..., "elf", "zwölf" ... ]
     }
    

提交回复
热议问题