AI / Google Antigravity Gemini Fundamentals Interview Questions
What is Gemini's native audio understanding capability and how do you use it?
Gemini models can directly process audio files - transcribing speech, answering questions about audio content, identifying speakers, and analysing audio characteristics. This is different from the Live API's real-time audio; it processes pre-recorded audio files.
from google import genai from google.genai import types from pathlib import Path client = genai.Client() # Method 1: Inline audio (small files < 20MB) audio_bytes = Path("interview.mp3").read_bytes() response = client.models.generate_content( model="gemini-3.5-flash", contents=[ types.Part( inline_data=types.Blob( data=audio_bytes, mime_type="audio/mp3" ) ), types.Part(text="Transcribe this interview and summarise the key points.") ] ) print(response.text) # Method 2: Upload via Files API (recommended for files > 20MB) uploaded = client.files.upload( file=Path("podcast.mp3"), config={"display_name": "Tech Podcast Episode 42"} ) # Wait for processing: import time while uploaded.state == "PROCESSING": time.sleep(2) uploaded = client.files.get(name=uploaded.name) # Analyse the audio: response = client.models.generate_content( model="gemini-3.5-flash", contents=[ types.Part(file_data=types.FileData(file_uri=uploaded.uri, mime_type="audio/mp3")), types.Part(text="How many different speakers are in this podcast? Identify each speaker's role.") ] ) print(response.text)
| Property | Detail |
|---|---|
| Supported formats | MP3, WAV, FLAC, AAC, OGG, OPUS, WebM audio |
| Max inline size | ~20MB (use Files API for larger) |
| Max duration (context window) | Approximately 9.5 hours of audio at 1M token context |
| Capabilities | Transcription, speaker diarisation, audio Q&A, summarisation |
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
