Gex*_*Gex 5 speech-recognition google-api speech-to-text google-speech-api google-cloud-speech
我正在尝试使用Google Cloud Speech API转录一个简短的采访音频文件,但它只能转录录音的前半分钟。我进行了多次尝试,录音时间超过一分钟,结果是相同的。我的问题是,如何获得给定文件的完整音频转录?
您可以在这里找到我的一个用例:
上载音频文件:
POST https://speech.googleapis.com/v1beta1/speech:asyncrecognize?key={YOUR_API_KEY}
{
"config": {
"encoding": "LINEAR16",
"sampleRate": 16000,
},
"audio": {
"uri": "gs://protean-blend-146812.appspot.com/record__2017_02_02_12_02_17_greg_16000.wav",
}
}
在响应中得到了操作编号:
{
"name": "8977932499808116064"
}
使用操作号进行请求:
GET https://speech.googleapis.com/v1beta1/operations/8977932499808116064?key={YOUR_API_KEY}
得到结果:
{
"name": "8977932499808116064",
"metadata": {
"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeMetadata",
"progressPercent": 100,
"startTime": "2017-02-02T11:21:41.346784Z",
"lastUpdateTime": "2017-02-02T11:23:03.150491Z"
},
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse",
"results": [
{
"alternatives": [
{
"transcript": "McGregor you have any stories about being lost that you have all the good advice well let me know in the Golden Triangle drug trafficking across the border",
"confidence": 0.8535113
}
]
},
{
"alternatives": [
{
"transcript": "we came across this Village very very poor Village People and some of the people there were really unfriendly they just started throwing rocks and my friend and we couldn't talk so we backed away went back quickly up the hill",
"confidence": 0.9027881
}
]
},
{
"alternatives": [
{
"transcript": "and we are wondering you know where to go and luckily I can see in the distance there in one tree",
"confidence": 0.8931573
}
]
}
]
}
}
我提出请求的链接(在“尝试一下!”部分):
归档时间: |
|
查看次数: |
853 次 |
最近记录: |