问题标签 [google-cloud-speech]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
google-api - 为什么 Google Cloud Speech API 不转录整个音频文件?
我正在尝试使用 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
}
]
}
]
}
}
我提出请求的链接(在“试试看!”部分):
ios - 谷歌云语音 API 响应:解析 iOS
我正在尝试将谷歌云语音 API 集成到我的演示应用程序中。我得到的结果如下:
获得响应的代码:
我的问题是,我得到的响应不是正确的 JSON,那么我如何获得 key 的值transcript
?任何帮助,将不胜感激。谢谢。
node.js - Node.JS 中的 Google Cloud Speech:配置 speech_context
我正在使用 Google Speech API 的 Node.JS 变体。
speech_context
在我敢于传入一个字符串参数数组之前,一切都很好而且很花哨。当我尝试以下每种方式时,流会中断,但不会发出错误。因此,我无法诊断。
我正在传递一系列字符串["one", "two", "three"]
,遵守文档,所以我相信。我的原始配置如下所示:
我试过cf.config.speech_context = ARRAY
, cf.config.speech_context.phrases = ARRAY
,cf.speech_context = ARRAY
和cf.speech_context.phrases = ARRAY
.
同样,我没有收到错误消息,也没有得到结果。我什么都得不到。原来的配置靠自己的作品。
这有一个基本的流:
想法?任何帮助将不胜感激!
python - 使用 pydub 为 Google Speech 导出音频
我正在尝试将音频文件导出到 LINEAR16 以用于 Google Speech,我注意到它们指定了 little-endian 字节顺序。我正在使用pydub导出为“原始”格式,但我无法从文档(或源代码)中判断导出的文件是小端格式还是大端格式?我正在使用以下命令进行导出:
谢谢你。-K
audio - Google Cloud Speech:单词开始时间
我正在考虑使用 Google Cloud Speech 来转换长格式的旁白音频文件,我需要知道音频文件中每个短语的开始时间。有没有办法用谷歌云语音做到这一点?我目前正在与transcribe_async.py
. 谢谢。
audio - Google Cloud Speech:配额组的令牌不足
当我尝试处理一个 10 分钟的音频文件时出现以下错误。我刚刚开始使用 Google Cloud 产品,因此我是唯一访问此资源的人。我怎么可能超过配额?配额设置为其默认值,我认为我没有接近限制。还有其他原因吗?我正在使用transcribe_async.py
演示代码。音频文件(22MB)存储在桶中,通过uri
音频源访问,否则演示代码不变。
android - 谷歌云语音在python中转录3gp
我无法使用谷歌云语音 api 转录一个简单的 3gp 音频文件。他们的示例在 audio.raw 上运行良好,但是当我将其更改为我的文件时,它出错了。
在我的 android 设备中录制是这样的:
我是这样转录的:
编码和采样率是正确的,但我得到:
google-speech-api - 使用没有 json 文件的 Google Application Default Credentials
我已经使用 c# 创建了一个控制台应用程序。我使用了谷歌云语音 api。我按照这个示例应用程序来创建应用程序。为了验证语音 api,我在 main 方法中编写了以下代码
一切正常。我的问题,我必须将 exe 与 json 文件一起发送。我不想公开 json 文件。如何在代码中嵌入 json 文件内容或在没有 json 文件的情况下进行身份验证?这样我只能将 exe 发送给用户。
对此的任何帮助将不胜感激。
谢谢。
reactjs - 使用 React Native 的 Google Cloud 语音
我正在尝试使用 Google Cloud Speech API,以便我可以传递音频文件并接收翻译后的文本,但我坚持集成。我已经有了 api 密钥和所需的一切,但无法从 react native 中找到如何使用它。在文档中只有对 node.js 的解释(来自 javascript 部分)。还有几个库过时或仅支持一个操作系统。有人成功了吗?
文档中的 node.js 示例: