首页 > 解决方案 > Google Cloud Speech API:如何获取超过 1 分钟的音频全文转录?

问题描述

我使用 Google Cloud Speech API (longrunningrecognize) 成功获得了 5 分钟长音频的成绩单和替代品,但我没有得到这 5 分钟的全文,只是一个小成绩单,如下所示:

{
  "name": "2340863807845687922",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeMetadata",
    "progressPercent": 100,
    "startTime": "2018-09-20T13:25:57.948053Z",
    "lastUpdateTime": "2018-09-20T13:28:18.406147Z"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeResponse",
    "results": [
      {
        "alternatives": [
          {
            "transcript": "I am recording it. I think",
            "confidence": 0.9223639
          }
        ]
      },
      {
        "alternatives": [
          {
            "transcript": "these techniques properly stated",
            "confidence": 0.9190353
          }
        ]
      }
    ]
  }
}

如何获取转录生成的全文?

标签: speech-recognitionspeech-to-textgoogle-speech-api

解决方案


使用 Google Speech API 是一件非常痛苦的事情。除了无法翻译长文件外,他们还会随机跳过转录中的大块音频。可能的解决方案是:

  1. 通过语音活动检测在块上拆分音频并分别转录每个块
  2. 使用更合理的服务,如 Speechmatics,他们将处理大文件,没有任何问题,更准确
  3. 使用 Kaldi 等开源语音识别器。

推荐阅读