Skip to content

Fix: Ensure consistent audio MIME type#5585

Open
9chait9 wants to merge 4 commits intogoogle:mainfrom
9chait9:fix/issue-5584
Open

Fix: Ensure consistent audio MIME type#5585
9chait9 wants to merge 4 commits intogoogle:mainfrom
9chait9:fix/issue-5584

Conversation

@9chait9
Copy link
Copy Markdown

@9chait9 9chait9 commented May 4, 2026

Fixes #5552

This PR addresses issue #5552 by ensuring that the LiveRequestQueue.send_realtime method consistently sets the audio MIME type. If a types.Blob is passed without an explicit mime_type, it will now default to 'audio/pcm;rate=16000'. Existing mime_type values will be preserved.

Testing Plan

  1. Set up a test environment: Configure the ADK with a LiveRequestQueue and a component that sends audio blobs.
  2. Scenario 1 (No explicit MIME type): Send an audio blob using LiveRequestQueue.send_realtime without specifying the mime_type in the types.Blob object.
  3. Verification 1: Inspect the outgoing request (e.g., using a network proxy or by logging within the LiveRequestQueue implementation) to confirm that the mime_type header or field for the audio blob is automatically set to 'audio/pcm;rate=16000'.
  4. Scenario 2 (Explicit MIME type): Send an audio blob using LiveRequestQueue.send_realtime with an explicitly provided mime_type (e.g., 'audio/opus').
  5. Verification 2: Inspect the outgoing request to confirm that the explicitly provided mime_type ('audio/opus') is preserved and used.

@adk-bot
Copy link
Copy Markdown
Collaborator

adk-bot commented May 4, 2026

Response from ADK Triaging Agent

Hello @9chait9, thank you for creating this PR!

To help reviewers better understand and test your fix, could you please add a testing plan section to your PR description? Additionally, for bug fixes, providing logs or a screenshot demonstrating the fix would be very helpful.

This information will help reviewers to review your PR more efficiently. Thanks!

@adk-bot adk-bot added the live [Component] This issue is related to live, voice and video chat label May 4, 2026
@9chait9
Copy link
Copy Markdown
Author

9chait9 commented May 4, 2026

Hi @adk-bot, thank you for the feedback! A detailed testing plan has already been included in the PR description. You can find it under the 'Testing Plan' section. Regarding logs/screenshots, this is an internal fix related to MIME type handling, which isn't easily demonstrated with screenshots. If specific logs are needed, please let me know, and I can provide them.

@9chait9 9chait9 marked this pull request as ready for review May 4, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

live [Component] This issue is related to live, voice and video chat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persistent APIError: 1007 None (Invalid Audio Format) in google-adk 1.31.1 using Vertex AI Live API

2 participants