DEV Community

VoiceDeveloper
VoiceDeveloper

Posted on

Using AI Voice for E-Commerce Product Descriptions

Why Voice AI Matters in E‑Commerce

When shoppers browse a catalog, the first thing they see is a headline, the second is a brief paragraph, and the third is often a short video or a voice‑over.

But what if you could deliver that same product narrative directly to a customer’s phone speaker—without them having to read?

Voice AI turns static text into an engaging, on‑demand audio experience that can boost conversion, improve accessibility, and add a touch of personality to your brand.

In this post we’ll walk through the practical steps to turn product descriptions into high‑quality audio clips using ElevenLabs. We’ll cover:

  • What the tech stack looks like
  • How to generate voice with a single API call
  • Tips for cloning your brand’s voice
  • Deployment tricks for a production‑ready service

Let’s dive in!

The Building Blocks

Component Why it matters
Text‑to‑Speech (TTS) Converts written product copy into natural‑sounding speech.
Voice Cloning Creates a unique voice that reflects your brand’s tone.
Audio Hosting Stores the generated MP3s so they can be streamed on product pages.
API Integration Keeps the workflow automated and scalable.

ElevenLabs provides an all‑in‑one TTS and voice‑cloning platform that’s battle‑tested in production. You can spin up a new voice in minutes and integrate it with your backend in less than an hour.

Step 1: Get Your API Key

  1. Sign up at https://try.elevenlabs.io/kr07zfuqn1bp.
  2. Navigate to API Keys in the dashboard.
  3. Copy the key and keep it safe—this is what your application will use to authenticate requests.

Tip: Store the key in a secrets manager (AWS Secrets Manager, HashiCorp Vault, or even a .env file in a local dev environment).

Step 2: Create a Voice Profile

ElevenLabs allows you to clone an existing voice or create a brand‑specific one from scratch. For e‑commerce, a warm, friendly voice usually works best.

curl -X POST "https://api.elevenlabs.io/v1/voices" \
     -H "xi-api-key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
           "name": "ShopperVoice",
           "description": "Friendly, conversational voice for product descriptions",
           "sample_url": "https://example.com/sample.wav"
         }'
Enter fullscreen mode Exit fullscreen mode

Replace YOUR_API_KEY with the key you just copied. The sample_url is optional but recommended—it speeds up voice‑cloning by providing a short audio clip of the desired voice.

ElevenLabs will return a voice_id you’ll use for every subsequent synthesis request.

Step 3: Synthesize Audio

Below are three ways to hit the synthesis endpoint—Python, JavaScript, and curl.

Python (Requests)

import requests
import json

API_KEY = "YOUR_API_KEY"
VOICE_ID = "voice_id_from_step_2"

text = (
    "Introducing the UltraComfort Ergonomic Chair—crafted with breathable mesh "
    "and lumbar support to keep you comfortable all day long."
)

payload = {
    "text": text,
    "voice_settings": {
        "stability": 0.5,
        "similarity_boost": 0.75
    }
}

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

response = requests.post(
    f"https://api.elevenlabs.io/v1/text-to-speech/{VOICE_ID}",
    headers=headers,
    data=json.dumps(payload)
)

if response.status_code == 200:
    with open("product_description.mp3", "wb") as f:
        f.write(response.content)
    print("Audio saved to product_description.mp3")
else:
    print("Error:", response.text)
Enter fullscreen mode Exit fullscreen mode

JavaScript (Fetch)

const apiKey = "YOUR_API_KEY";
const voiceId = "voice_id_from_step_2";
const text = `Introducing the UltraComfort Ergonomic Chair—crafted with breathable mesh and lumbar support to keep you comfortable all day long.`;

fetch(`https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`, {
  method: "POST",
  headers: {
    "xi-api-key": apiKey,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    text,
    voice_settings: { stability: 0.5, similarity_boost: 0.75 },
  }),
})
  .then((res) => res.blob())
  .then((blob) => {
    const url = URL.createObjectURL(blob);
    const audio = new Audio(url);
    audio.play();
  })
  .catch(console.error);
Enter fullscreen mode Exit fullscreen mode

curl

curl -X POST "https://api.elevenlabs.io/v1/text-to-speech/voice_id_from_step_2" \
     -H "xi-api-key: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
           "text": "Introducing the UltraComfort Ergonomic Chair—crafted with breathable mesh and lumbar support to keep you comfortable all day long.",
           "voice_settings": {
             "stability": 0.5,
             "similarity_boost": 0.75
           }
         }' \
     --output product_description.mp3
Enter fullscreen mode Exit fullscreen mode

All three examples produce a high‑quality MP3 file ready to be uploaded to your CDN or static hosting bucket.

Integrate Into Your Product Page

Once you have the MP3, the next step is to make it playable on your site:

<audio controls src="https://cdn.yourstore.com/audio/product_description.mp3"></audio>
Enter fullscreen mode Exit fullscreen mode

You can also add a “Listen Now” button that triggers the audio via JavaScript. For mobile users, consider auto‑muting or offering a short preview to avoid surprise playback.

Dynamic Generation on Demand

If you have a large catalog, generating audio for every product upfront can be costly. Instead, generate on demand:

  1. Store the product description text in your database.
  2. When a visitor clicks “Listen”, call the ElevenLabs endpoint via a serverless function.
  3. Cache the resulting MP3 in a CDN for subsequent requests.

This approach keeps your storage footprint small and scales with traffic.

Best Practices

Practice Why it matters
Limit Text Length ElevenLabs allows up to 2,000 characters per request. For longer descriptions, split into sections.
Use Voice Settings Wisely stability controls how much the voice deviates from the base model. similarity_boost makes the voice closer to the cloned voice. Experiment to find the sweet spot.
Batch Requests If you’re generating many descriptions at once (e.g., nightly jobs), batch them to reduce overhead.
Keep an Eye on Rate Limits ElevenLabs’ free tier caps at 100 requests per minute. Upgrade or throttle your jobs accordingly.

Advanced: Personalizing the Voice

If you want your brand’s voice to be unmistakable, consider using the Voice Cloning feature:

  1. Upload 5–10 short audio clips of a real person speaking product‑like language.
  2. Let ElevenLabs train a new voice model.
  3. Use the new voice_id in your synth calls.

The result is a voice that feels native to your brand—think Amazon’s “Alexa” or the distinct tones of a luxury retailer.

Wrap‑Up

Voice AI isn’t just a gimmick—it’s a powerful channel for engaging customers, improving accessibility, and boosting conversion rates. With ElevenLabs, you can go from text to polished, brand‑aligned audio in under a minute, thanks to a clean REST API and generous free tier.

Want to see how smooth it is to add audio to your e‑commerce store? Sign up at https://try.elevenlabs.io/kr07zfuqn1bp and start generating voice‑rich product descriptions today. Happy coding!

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.