Skip to content

A small improvement idea for the Gemini LiveAPI example #982

@souadeli

Description

@souadeli

Description of the feature request:

Hey Gemini team

I’ve been playing around with the Gemini LiveAPI. While testing the sample (Get_started_LiveAPI.py), I reworked a few parts to make it run smoother, especially the async flow, audio&video handling, and graceful shutdowns. It’s cleaner, faster, and a bit easier to follow.
I’d love to share this version or open a pull request on the Gemini Cookbook repo if that helps others experimenting with the API.
Thanks for building something this exciting.

ai_studio_code SE.py

Cheers,

What problem are you trying to solve with this feature?

Readability & structure

=> Clear section headers and consistent naming (AudioVideoLoop, _capture_frame, etc.)

=> Grouped related functions logically (audio, video, text, stream).

Error handling

=> Added safe finally: to close audio streams cleanly.

=> Used traceback.print_exc() for better debugging.

Any other information you'd like to share?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions