A modern, front-end web application for professional-grade Text-to-Speech (TTS) generation and accurate Speech-to-Text (STT) transcription services. The project is designed for deployment as a static site and implements a robust security pattern to protect API keys.
- AI Model: Utilizes the Google Gemini API (
gemini-2.5-flash-preview-tts) for high-fidelity voice synthesis. - Voice Library: Provides multiple prebuilt voice options (e.g., Kore, Puck, Zephyr, Charon).
- Output: Generates and allows download of audio files in WAV format.
- Real-time Transcription: Captures spoken input via the user's microphone and transcribes it in real-time.
- Browser API: Built upon the native
webkitSpeechRecognitionAPI. - Output: Transcriptions are presented in an editable text area and are downloadable as a TXT file.
- Front-End: Pure HTML, CSS, and Vanilla JavaScript.
- Styling: A sleek, dark-mode professional aesthetic is achieved using the Tailwind CSS framework.
This is a static front-end application that does not require a build process. It only requires a valid Gemini API Key for the TTS functionality.
The API key must be available for the application to function, but it cannot be committed to the public repository.
- Git Ignore: The repository uses a
.gitignorefile to excludesecrets.jsfrom all commits. - Local File Creation: In the root directory of the project, create a file named
secrets.jsand paste your live API key into it:(Note: The main// secrets.js const CHATTERBOX_API_KEY = "YOUR_LIVE_GEMINI_API_KEY_HERE";
script.jsfile expects and uses theCHATTERBOX_API_KEYvariable from this file.) - Local Run: Open the
index.htmlfile directly in your web browser.
# Clone the repository
git clone https://github.com/shahvez-khan/ChatterBox.git
# Navigate to the project directory
cd ChatterBox
# Perform API Key Setup (Step 1)To make the live site fully functional, the API key file must be present on the web host.
-
Enable GitHub Pages:
- On the GitHub repository page, navigate to Settings > Pages.
- Set Source to
Deploy from a branch. - Set Branch to
mainand the folder to/(root). Click Save.
-
Manual Upload of
secrets.js:- Once the repository is deployed, upload the local
secrets.jsfile directly to the root of themainbranch via the GitHub web interface. - This critical step bypasses the Git history while making the key available to the live environment.
- Once the repository is deployed, upload the local
The live version of this application is hosted here:
This project is licensed under the MIT License.
The MIT License is a permissive free software license, meaning it allows reuse for any purpose, subject to the condition that the copyright and permission notice is preserved.