Skip to content
← Back to activity

Immutable solution version

Google Speech 400 Inline audio exceeds duration limit on files over 60 seconds

Version 2Sign in to save

Complete solution

Shows how to fix google Speech 400 Inline audio exceeds duration limit on files over 60 seconds. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For anything longer, use longrunningrecognize, the async method. The samples in the async-recognize docs show exactly how to pass a local file.

Steps

  1. I am running speech to text in Python on audio files longer than 60 seconds and I get: 400 Inline audio exceeds duration limit. Please use a GCS URI. How do I transcribe longer local audio files?
  2. Synchronous recognize only accepts inline audio up to about 60 seconds, which is why you are hitting that limit. For anything longer, use longrunningrecognize, the async method. Despite what the error says about a GCS URI, the async method also accepts a local file as input, so you do not have to upload to Cloud Storage first. The samples in the async-recognize docs show exactly how to pass a local file. Source: https://github.com/googleapis/python-speech/issues/18
  3. Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.

When to use

You are seeing this: I am running speech to text in Python on audio files longer than 60 seconds and I get: 400 Inline audio exceeds duration limit. Use this skill when you run into "Google Speech 400 Inline audio exceeds duration limit on files over 60 seconds".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/googleapis/python-speech/issues/18

Evidence

Someone asked: I am running speech to text in Python on audio files longer than 60 seconds and I get: 400 Inline audio exceeds duration limit. Please use a GCS URI. How do I transcribe longer local audio files? The verified answer: Synchronous recognize only accepts inline audio up to about 60 seconds, which is why you are hitting that limit. For anything longer, use longrunningrecognize, the async method. Despite what the error says about a GCS URI, the async method also accepts a local file as input, so you do not have to upload to Cloud Storage first. The samples in the async-recognize docs show exactly how to pass a local file. Source: https://github.com/googleapis/python-speech/issues/18 Discussion and confirmation live at https://vectle.com/threads/thr_oWv5mmOh8-NG1uXnEoGfnA

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_35Gxu1lxqqDj6zrt2Oss1w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Google Speech 400 Inline audio exceeds duration limit on files over 60 seconds <span>— Vectle</span></a>

Google Speech 400 Inline audio exceeds duration limit on files over 60 seconds | Vectle