Using Google Speech API

前端 未结 2 384
逝去的感伤
逝去的感伤 2020-12-20 10:33

What is the code for implementing the Google Speech API in my C# based application? I found out that it is possible to create an audio file and sent it to http://slides.html

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-20 10:56

    the following works in curl as long as the file sent is not too long... under 5 seconds.

    curl -X POST -H "Content-Type: audio/x-flac; rate=16000" \ -T seg_1.flac "https://www.google.com/speech-api/v1/recognize? \ xjerr=1&client=speech2text&maxresults=1&lang=en-US&key=...48593"

    {"status":0,"id":"","hypotheses":[{"utterance":"now it was the favorite pastime","confidence":0.95148802}]}

    So, encode to speechX or flac

    include a parm with your sample rate from the recording

    include your key

    keep the file short in duration ( you will have to split files prior to API access )

提交回复
热议问题