cd /news/ai-tools/build-a-voice-notification-system-wi… · home › topics › ai-tools › article
[ARTICLE · art-145078] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Build a Voice Notification System with ElevenLabs

A developer published a walkthrough for building a voice notification system on top of ElevenLabs, the cloud text-to-speech service, covering API key setup, voice cloning from a 30–60 second audio sample, and both synchronous and streaming speech synthesis endpoints. The guide includes Python and Node.js code for generating MP3 alerts and a webhook example that triggers a spoken notification when a new support ticket arrives.

by read4 min views1 publishedOct 5, 2026

In a world where instant alerts are the new status updates, a voice‑first notification system can turn a simple “you have a new message” into an engaging, hands‑free experience. Whether you’re building a smart home dashboard, a customer‑support bot, or a mobile app that needs to keep users informed even when their eyes are elsewhere, text‑to‑speech (TTS) gives you that extra layer of accessibility and immersion.

Instead of relying on generic TTS engines that sound robotic, modern voice AI platforms let you create personalized, natural‑sounding voices that match your brand or user persona. In this post we’ll walk through how to build a lightweight voice notification system using ElevenLabs—a cloud‑based TTS service that offers high‑quality voice cloning, real‑time streaming, and an easy‑to‑use API.

Before we dive into code, head over to the ElevenLabs sign‑up page and register. They provide a generous free tier that’s perfect for prototyping. Once you’re signed up, grab your API key from the dashboard.

Tip: Keep your API key secret. Store it in environment variables or a secrets manager.

ElevenLabs supports two main modes:

Mode Use‑Case Example
Standard Quick, one‑off notifications “Hey, your order has shipped.”
Voice Cloning Brand‑specific or personalized voices A “virtual assistant” that sounds like your CEO.

To clone a voice, you’ll need a short audio sample (30‑60 seconds). ElevenLabs will process it and generate a voice model you can reuse.

curl -X POST "https://api.elevenlabs.io/v1/voices" \
  -H "xi-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "my-brand-voice",
        "description": "Voice for our brand assistant"
      }'

You’ll receive a voice_id that you’ll use in subsequent requests.

Once you have a voice ID, you can synthesize speech. ElevenLabs offers both synchronous (downloadable audio file) and streaming (real‑time audio) endpoints. For a notification system, streaming is usually the way to go so users hear the alert immediately.

import os
import requests

API_KEY = os.getenv("ELEVENLABS_API_KEY")
VOICE_ID = "my-brand-voice"
TEXT = "Your order is now on the way!"

headers = {
    "xi-api-key": API_KEY,
    "accept": "audio/mpeg",
    "Content-Type": "application/json"
}

data = {
    "text": TEXT,
    "voice_id": VOICE_ID,
    "model_id": "eleven_monolingual_v1",
    "output_format": "mp3"
}

response = requests.post(
    "https://api.elevenlabs.io/v1/text-to-speech/" + VOICE_ID,
    headers=headers,
    json=data,
    stream=True
)

with open("notification.mp3", "wb") as f:
    for chunk in response.iter_content(chunk_size=1024):
        if chunk:
            f.write(chunk)
js
const fs = require('fs');
const fetch = require('node-fetch');

const apiKey = process.env.ELEVENLABS_API_KEY;
const voiceId = 'my-brand-voice';
const text = 'Your meeting starts in 5 minutes.';

const payload = {
  text,
  voice_id: voiceId,
  model_id: 'eleven_monolingual_v1',
  output_format: 'mp3'
};

fetch(`https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`, {
  method: 'POST',
  headers: {
    'xi-api-key': apiKey,
    'Content-Type': 'application/json',
    'Accept': 'audio/mpeg'
  },
  body: JSON.stringify(payload)
})
  .then(res => res.body.pipe(fs.createWriteStream('meeting.mp3')))
  .catch(console.error);

Let’s tie everything together. Imagine you’re building a Node.js backend that sends a voice alert whenever a new support ticket lands.

app.post('/webhook/ticket', async (req, res) => {
  const { ticketId, priority } = req.body;

  const message = `New ticket #${ticketId} with priority ${priority}.`;

  // Call ElevenLabs (reuse the snippet from above)
  // ...

  // Respond with the audio URL or stream
  res.json({ audio_url: 'https://yourcdn.com/notifications/ticket.mp3' });
});

If you prefer a real‑time experience, ElevenLabs also supports WebSocket streaming. The API documentation walks you through the exact handshake and data format. For most use‑cases, the synchronous endpoint is sufficient and much easier to debug.

You can tweak pitch, speed, and emphasis to make alerts feel urgent or calm. ElevenLabs lets you pass these parameters in the request body:

{
  "text": "Attention: system overload detected!",
  "voice_id": "my-brand-voice",
  "model_id": "eleven_monolingual_v1",
  "output_format": "mp3",
  "voice_settings": {
    "stability": 0.5,
    "similarity_boost": 0.5,
    "style": 0.75,
    "use_speaker_boost": true
  }
}

Play around with stability (clarity vs. naturalness) and similarity_boost (how close the clone sounds to the source). The best way to find the sweet spot is to generate a few samples and let your users vote.

Scenario Recommendation
Large Text Break into sentences, synthesize each chunk separately, then concatenate.
Multiple Languages ElevenLabs supports multi‑lingual models. Specify model_id: eleven_multilingual_v1 and set thelanguage field.
Rate Limits Cache generated audio for frequent alerts. Use a CDN to serve the MP3s.
User Preferences Allow users to toggle voice notifications on/off and choose between default or personalized voices.

If you want your notifications to reach Amazon Alexa or Google Home, you’ll need to expose an HTTPS endpoint that the voice assistant can call. Once you have the audio file, you can push it to the device using the respective SDKs. ElevenLabs’ API is agnostic of the target device, so you’re free to build a multi‑platform notification engine.

Building a voice notification system isn’t just about converting text to speech; it’s about delivering information in a way that feels natural and engaging. With ElevenLabs, you get:

Now that you have the roadmap, it’s time to add that human touch to your alerts. Try ElevenLabs today and transform your notification strategy into a voice‑rich experience that users will appreciate.

Ready to get started? Sign up now at https://try.elevenlabs.io/kr07zfuqn1bp and let your messages speak for themselves.

── more in #ai-tools 4 stories · sorted by recency
── more on @elevenlabs 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/build-a-voice-notifi…] indexed:0 read:4min 2026-10-05 · —