This Node.js application converts a string of text into a WAV audio file using the Google Gemini API.
1/13/2026 Used work Copilot (Cluade) to fix the native method. Everything working well except audio output still quiet / not rendering. No matter the method used, live or tts.
1/12/2026 7:13pm Exhausted Copilot credits for personal account. Checking everything in for easy access from work machine. Gemini code assist works but is slow and awkward. Still do not have a single working audio file
1/11/2026 12:50pm service account deleted and calls started being rejected, quota exceeded limit 10. Looks like it is just that. Exceeded 10 requests per day rate limit https://aistudio.google.com/usage?timeRange=last-7-days&project=gemini-api-key-project-484003&tab=rate-limit
Gemini: Search results from this week (Jan 2026) confirm that many developers are seeing exactly what you described: The "Sizzling" Bug: There is a confirmed regression in the 2.5-flash-preview-tts model where a "metallic sizzling" or "radio interference" background noise appears, even on short text.
- Node.js installed (https://nodejs.org/)
- A Google Gemini API Key.
- Clone or download the repository
- Get your API key from Google AI Studio: https://aistudio.google.com/app/apikey
- Create a copy of the
.env.examplefile and rename it to.env. - In the
.envfile, set theGEMINI_API_KEYvariable to the API key you just obtained.
Example .env file:
GEMINI_API_KEY="your...key...here"
To run the program:
-
Install dependencies:
npm install
-
Set up your
.envfile with yourGEMINI_API_KEY(see Setup section below) -
Edit the text and voice in
index.js:const textToConvert = 'Your text here'; const chosenVoice = VOICES.ZEPHYR; // or another available voice const voiceTone = 'enthusiastic'; // or blank const voiceAccent = 'British'; // or blank
-
Run the program:
npm start
or
node index.js
The script will generate an output.wav file with the synthesized speech.
Available commands:
npm start- Convert text to speech (default tts-mode)npm run list-models- List available modelsnpm run list-gen-models- List generative modelsnpm start tts-mode- Text-to-speech mode (TTS API)npm start live-mode- CURRENTLY UNSUPPORTED - Native audio engine mode (Live API)
The example uses the Puck voice. You can change this to any of the following pre-built voices:
Achernar- FemaleAchird- Male, FriendlyAlgenib- Male, GravellyAlgieba- Male, SmoothAlnilam- Male, FirmAoede- Female, BreezyAutonoe- Female, BrightCallirrhoe- Female, Easy-goingCharon- Male, InformativeDespina- Female, SmoothEnceladus- Male, BreathyErinome- Female, ClearFenrir- Male, ExcitableGacrux- Female, MatureIapetus- Male, ClearKore- Female, FirmLaomedeia- Female, UpbeatLeda- Female, YouthfulOrus- Male, FirmPuck- Male, UpbeatPulcherrima- Female, ForwardRasalgethi- Male, InformativeSadachbia- Male, LivelySadaltager- Male, KnowledgeableSchedar- Male, EvenSulafat- Female, WarmUmbriel- Male, Easy-goingVindemiatrix- Female, GentleZephyr- Female, BrightZubenelgenubi- Male, Casual
These voices are available through the Gemini API's text-to-speech models.
While the voices do not have a fixed ethnicity or accent, you can control the accent by providing instructions in the text prompt. The Gemini API allows for nuanced control over the voice's accent and language.
To generate speech with an Australian accent, you can modify the text prompt in index.js as follows:
const textToConvert = 'Say with an Australian accent: G\'day mate, how ya going?';You can experiment with different accents and languages by changing the instruction in the prompt.
Create a project before you can get an API key
https://console.cloud.google.com/
- Project name: Gemini-Api-Key-Project
- Project ID: gemini-api-key-project-484003
- Project number: 955770032652
- Project path: projects/955770032652
- Api Key Name: Generative Language API Key, created on Jan 10, 2026
Import the Cloud Console project in AI Studio in order to create an API Key
https://aistudio.google.com/api-keys
Find usage count information and daily api limits
https://aistudio.google.com/usage
If a "rate limit" error occurs, monitor your usage and request limits here
Rate limits may also exist until a billing card is put on file (even though access is still free)
https://console.cloud.google.com/billing
Takes 15 to 30 minutes (and sometimes up to 24 hours) for a new billing account to propagate across all Google services. If you just added the card, the API might still be looking at a cached version of your "Unbilled/Limit 0" status.
API can be disabled by default. Visit the following page and click the "Enable" button
Account created. This may not have been necessary
- Service account name: JeremyGeminiService
- Service account ID: jeremygeminiservice