首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >google speech api gaxerror

google speech api gaxerror
EN

Stack Overflow用户
提问于 2018-02-16 21:54:09
回答 1查看 197关注 0票数 0

我正在使用Google Speech API通过以下Python脚本https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/speech/cloud-client/transcribe_async.py和以下命令转录音频文件:

代码语言:javascript
复制
python transcribe_async.py 1503489730.193982.flac

我得到的回应是这样的:

代码语言:javascript
复制
Waiting for operation to complete...
Traceback (most recent call last):
  File "transcribe_async.py", line 102, in <module>
    transcribe_file(args.path)
  File "transcribe_async.py", line 52, in transcribe_file
    response = operation.result(timeout=200)
  File "/home/toto/anaconda3/lib/python3.5/site-packages/google/gax/__init__.py", line 596, in result
    raise GaxError(self._operation.error.message)
google.gax.errors.GaxError

我找不出错误是什么。我可能配置了错误的音频参数,我真的不知道。

谢谢

EN

回答 1

Stack Overflow用户

发布于 2018-02-26 04:12:17

Linear16是唯一可接受的异步格式。Uncompressed 16-bit signed little-endian samples (Linear PCM). This is the only encoding that may be used by AsyncRecognize.参见documentation

您可以将mp3转换为raw,如下所示:

代码语言:javascript
复制
sox async.mp3 -t raw --channels=1 --bits=16 --rate=16000 --encoding=signed-integer --endian=little async.raw
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48828318

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档