Skip to content

v0.6.0

Release Date: 2026-01-19

Native telephony audio format support for Twilio Media Streams integration.

Highlights

This release adds native support for telephony audio codecs (G.711 μ-law/A-law) in the OmniVoice format mapping, enabling seamless integration with Twilio Media Streams and other telephony platforms without audio conversion overhead.

New Features

Telephony Audio Format Support

The OmniVoice format mapper now supports telephony codecs natively:

Format Input ElevenLabs Output Use Case
ulaw, mulaw, g711u ulaw_8000 Twilio Media Streams, North American telephony
alaw, g711a alaw_8000 European telephony, some VoIP systems
pcm @ 8kHz pcm_8000 Raw telephony audio

Key benefit: ElevenLabs outputs G.711 audio directly - no server-side transcoding needed for the TTS → Twilio path.

Usage with OmniVoice:

import (
    "github.com/agentplexus/go-elevenlabs/omnivoice/tts"
    "github.com/agentplexus/omnivoice/pipeline"
)

provider, _ := tts.New()

// Configure for Twilio Media Streams (μ-law audio)
config := pipeline.TTSPipelineConfig{
    VoiceID:      "Rachel",
    OutputFormat: "ulaw",      // Maps to ulaw_8000
    SampleRate:   8000,        // Telephony sample rate
    Model:        "eleven_turbo_v2_5",
}

ttsPipeline := pipeline.NewTTSPipeline(provider, config)

// Audio streams directly to Twilio without conversion
err := ttsPipeline.SynthesizeToConnection(ctx, "Hello!", twilioConn)

Format Prefix Recognition

The format mapper now recognizes ElevenLabs-native format prefixes and passes them through unchanged:

  • ulaw_* (e.g., ulaw_8000)
  • alaw_* (e.g., alaw_8000)
  • opus_* (e.g., opus_48000_192)

This allows direct use of ElevenLabs format strings when needed.

Integration Examples

A new examples repository has been created for integration examples with external dependencies:

Repository: agentplexus/omnivoice-examples

twilio-elevenlabs-voice-agent

Complete voice agent example using:

  • Twilio Media Streams for telephony transport
  • ElevenLabs TTS with native μ-law output
  • OmniVoice pipeline framework
┌──────────┐        ┌─────────────────┐        ┌───────────────────────────────┐
│  Caller  │◄──────►│     Twilio      │◄──────►│         OmniVoice             │
│  (PSTN)  │  PSTN  │   Media         │WebSocket│                               │
└──────────┘        │   Streams       │ (μ-law) │  ┌─────┐           ┌─────┐   │
                    └─────────────────┘         │  │ STT │◄──────────│ TTS │   │
                                                │  └──┬──┘  (text)  └──┬──┘   │
                                                │     │                 │      │
                                                │     ▼                 │      │
                                                │  ┌─────────────────┐  │      │
                                                │  │       LLM       │──┘      │
                                                │  │    (Claude)     │         │
                                                │  └─────────────────┘         │
                                                └───────────────────────────────┘

Installation

go get github.com/agentplexus/go-elevenlabs@v0.6.0

Upgrade Notes

This release is backward compatible. Existing code continues to work unchanged.

For telephony integration:

  1. Use "ulaw" or "mulaw" as the output format for Twilio Media Streams
  2. Set sample rate to 8000 for telephony
  3. Use eleven_turbo_v2_5 model for lowest latency

Dependencies

  • Bump github.com/grokify/mogo from 0.72.5 to 0.72.6