How lugodoy/conversando-por-voz works
Purpose and Execution Model
This repository is a single Google Colab-oriented Python notebook implementing an interactive voice-to-voice generative-AI workflow. Its primary and only executable entry point is conversando_por_voz.ipynb; users upload it to Colab, configure a secret, and run cells sequentially.
User Audio Capture
The notebook captures microphone audio from the browser. This is a notebook/browser boundary: JavaScript handles browser microphone permission and recording, while Python receives the resulting audio for downstream processing. The Colab runtime is required for this interaction model.
• conversando_por_voz.ipynb
Speech-to-Text Stage
Recorded audio is passed to OpenAI Whisper for transcription into text. This stage converts an audio artifact into the textual user prompt consumed by the language-model stage.
• conversando_por_voz.ipynb
Generative Response Stage
The transcribed prompt is sent to Google Gemini through Google’s API. Access is gated by the GOOGLE_API_KEY secret configured in Colab Secrets; the key should remain outside notebook source and repository files. Gemini’s generated text becomes the canonical assistant response.
• conversando_por_voz.ipynb
Text Preparation and Text-to-Speech
The notebook performs text cleanup intended to improve spoken output, then sends the response text to gTTS to synthesize audio. This creates the final response audio presented back to the user.
• conversando_por_voz.ipynb
End-to-End Data Flow
Control is user-driven through ordered notebook cells: microphone recording → audio data/file → Whisper transcription → Gemini prompt/API response → cleaned response text → gTTS audio synthesis → browser playback. Each stage depends on output from the preceding cell, rather than a persistent service, API server, or application backend.
• conversando_por_voz.ipynb
Runtime and External Dependencies
Material infrastructure consists of a Google Colab Python 3.10+ environment and a browser with microphone access. External services/libraries are Whisper for STT, Google Gemini for inference, and gTTS for speech synthesis. There is no separate deployment, package structure, database, or server entry point.
• README.md
• conversando_por_voz.ipynb
Main entry points: conversando_por_voz.ipynb Google Gemini API
Components 12
Colab Runtime
Cells run sequentially in a Python 3.10+ Colab session.
- Voice Conversation Notebook · The repository's only executable workflow.
conversando_por_voz.ipynb - Recorded Audio
conversando_por_voz.ipynb - Colab Secrets · Supplies GOOGLE_API_KEY outside notebook source.
conversando_por_voz.ipynb - Text Cleanup · Prepares generated text for natural spoken output.
conversando_por_voz.ipynb
AI Processing
- Whisper Transcription · Converts recorded speech into a textual prompt.
conversando_por_voz.ipynb - User Prompt
conversando_por_voz.ipynb - Google Gemini API · Generates the canonical assistant response.
conversando_por_voz.ipynb - Assistant Response
conversando_por_voz.ipynb - gTTS Synthesis · Synthesizes cleaned text into response audio.
conversando_por_voz.ipynb
Other components
- User
- Browser Microphone · Requests microphone access and records audio with JavaScript.
conversando_por_voz.ipynb - Browser Playback · Presents synthesized response audio to the user.
conversando_por_voz.ipynb
Connections 12
- User → Browser Microphone: speaks
- Browser Microphone → Voice Conversation Notebook: audio capture
- Voice Conversation Notebook → Recorded Audio: receives
- Recorded Audio → Whisper Transcription: transcribe
- Whisper Transcription → User Prompt: produces
- User Prompt → Google Gemini API: send prompt
- Colab Secrets → Google Gemini API: GOOGLE_API_KEY
- Google Gemini API → Assistant Response: generates
- Assistant Response → Text Cleanup: clean text
- Text Cleanup → gTTS Synthesis: synthesize
- gTTS Synthesis → Browser Playback: response audio
- Browser Playback → User: hears