Voice AI Development on Voximplant: VoxEngine & STT/TTS Integration
Outbound calling to 500 contacts — the bot answers with a 4-second delay, customers hang up. We encountered this when a real estate company was losing 30% of leads due to pauses. After integrating Voximplant with an AI backend, we reduced latency to 600 ms, and conversation conversion increased by 40%. One project saved the client 1.2 million rubles per year by reducing operator headcount.
The Russian platform Voximplant with VoxEngine gives full control over the call, but its integration with AI models requires fine-tuning of streaming audio, VAD, and queue management. Over 5 years of work, we have implemented more than 30 voice AI solutions on Voximplant. Our engineers are certified Voximplant Developers and know how to squeeze at least 200 ms latency at the STT stage.
What Problems We Solve
High response latency is the main pain. With sequential audio processing (call → recording → recognition → response), latency reaches 3–5 seconds. A pause of 1.5 seconds is already noticeable to the user. The solution is streaming processing via WebSocket: audio is transmitted in 30 ms frames, and voice VAD runs in parallel.
Unstable recognition with background noise or fast speakers. We use models with adaptive noise reduction (e.g., Silero VAD) and adjust sensitivity for each channel.
Scaling issues — VoxEngine scripts run in a single thread, and with 100+ simultaneous calls you easily hit limits. We design architecture with a message queue (RabbitMQ/NATS) and a pool of AI workers to distribute load.
How the Voximplant with AI Integration Works
The main pattern: VoxEngine opens a WebSocket connection to our Python backend for each call. The entire audio stream goes through it, controlled by events.
// VoxEngine scenario (JavaScript)
VoxEngine.addEventListener(AppEvents.CallAlerting, (e) => {
const call = e.call;
call.answer();
// Create a WebSocket connection to our AI backend
const wsConn = VoxEngine.createWSClient(`wss://api.yourapp.com/voxi-stream`);
// Bind call audio to WebSocket
call.sendMediaTo(wsConn);
wsConn.sendMediaTo(call);
wsConn.addEventListener(WSClientEvents.ConnectionClosed, () => {
call.hangup();
});
call.addEventListener(CallEvents.Disconnected, () => {
wsConn.close();
});
});
On the backend, FastAPI receives the stream, accumulates audio in a buffer, detects the end of a phrase (VAD), and sends it to an ASR model. The result goes to TTS, and the synthesized speech is sent back.
from fastapi import FastAPI, WebSocket
import asyncio
@app.websocket("/voxi-stream")
async def voximplant_stream(websocket: WebSocket):
await websocket.accept()
session = VoiceSession()
# Send greeting
greeting_audio = await tts.synthesize("Hello! How can I help you?")
await websocket.send_bytes(greeting_audio)
audio_buffer = bytearray()
silence_frames = 0
async for chunk in websocket.iter_bytes():
audio_buffer.extend(chunk)
silence_frames = 0 # reset on audio receipt
# Process every 1.5 seconds of accumulated audio
if len(audio_buffer) >= 24000 * 2: # 1.5 sec @ 16kHz 16-bit
response = await process_utterance(bytes(audio_buffer), session)
if response:
audio_response = await tts.synthesize(response)
await websocket.send_bytes(audio_response)
audio_buffer = bytearray()
For more details on the protocol, see WebSocket. Contact us to discuss your scenario and get a demo of streaming processing.
What Using VoxEngine Provides
VoxEngine is not a proxy — it's a full JavaScript engine inside the call. It allows flexible media flow control: mixing audio, switching channels, adding DTMF. For AI scenarios, this means we can play pre-recorded messages (e.g., "Please wait") while the AI model processes the request — without delay.
| Comparison | VoxEngine + WebSocket | REST API (request-response) |
|---|---|---|
| Latency (p99) | 400–800 ms | 2–5 s |
| Scaling | 500+ simultaneous calls | 50–100 calls |
| Infrastructure cost | Moderate (one WebSocket server) | High (depends on number of HTTP workers) |
| Dialog flexibility | Real-time, interruptible | Only sequential requests |
The table shows that VoxEngine + WebSocket provides latency of 400–800 ms, which is 5–10 times faster than REST API.
Comparison of Popular ASR/TTS Models
| Model | Latency (p50) | Accuracy (WER) | Languages |
|---|---|---|---|
| Whisper (large) | 300 ms | 5% | 99 |
| Silero | 150 ms | 8% | 2 |
| Google STT | 200 ms | 6% | 125 |
| Yandex SpeechKit | 250 ms | 7% | ru/en |
Model selection depends on required accuracy and budget. For Russian, we often recommend Yandex SpeechKit or Whisper.
Why Voximplant Is Better for Voice AI
Voximplant documentation confirms: the platform was originally designed for real-time communications. Unlike ordinary SIP trunks, VoxEngine allows processing audio at the JavaScript level, achieving sub-second delays with proper integration.
How to Reduce Latency to 200 ms
Achieving 200 ms at the STT stage is only possible with a comprehensive approach:
- Use VAD with a low threshold (Silero VAD with threshold 0.3)
- Preload ASR model into GPU memory
- Use streaming ASR (e.g., Whisper cpp in real-time mode)
- Optimize audio frame size (30–50 ms)
More on VAD configuration
VAD (Voice Activity Detection) is critical for reducing latency. We recommend using Silero VAD with threshold 0.3 and min_silence_duration_ms 150. This cuts pauses and avoids wasting time transmitting silence.Outbound Calling: How to Automate Mass Campaigns
For outbound calls, Voximplant provides the StartScenarios API. We run campaigns with personalization: passing the client's name and context of previous interactions into the scenario.
import requests
def start_outbound_campaign(contacts: list[dict]):
"""Start mass outbound calling via Voximplant API"""
for contact in contacts:
response = requests.post(
"https://api.voximplant.com/platform_api/StartScenarios/",
data={
"account_name": VOXI_ACCOUNT,
"api_key": VOXI_API_KEY,
"rule_name": "outbound_bot",
"script_custom_data": json.dumps({
"phone": contact["phone"],
"customer_name": contact["name"],
"context": contact.get("context", {})
}),
"reference_to_call_id": contact["phone"]
}
)
Typical errors: not handling busy lines/unavailability — we add retry with exponential backoff and log hang-up reasons.
What the Work Includes
- Audit of current telephony and AI scenario requirements.
- Architecture design: ASR/TTS selection, VAD, WebSocket connection setup.
- Development of VoxEngine scenario and Python backend (FastAPI, asyncio).
- Integration with CRM and accounting systems (if needed).
- Load testing (1000+ virtual calls).
- Scenario and API documentation.
- Operator training and 3 months of post-launch support.
Work Process
- Analytics — we study your dialogues, identify intents and slots.
- Prototype — in 5 days we make an MVP on one scenario (e.g., answers to frequent questions).
- Development — write VoxEngine code, connect selected ASR/TTS, configure VAD.
- Testing — run 100+ test calls, measure latency and recognition quality.
- Production launch — deploy production infrastructure, set up monitoring (Grafana, Alertmanager).
- Support — monitoring, model retraining, scenario refinement based on statistics.
Estimated Timelines
- Basic integration (one scenario, out-of-the-box ASR/TTS) — from 1 to 2 weeks.
- Full production with outbound calling, 3+ intents, CRM integration — from 1.5 to 2 months.
- Cost is calculated individually, depending on dialog complexity and latency requirements.
Describe your task — we will prepare a commercial proposal with architecture and timelines within 1 day. We guarantee 99.9% SLA and a reduction in bot response time to 200 ms. Request a consultation now and get an analysis of your current telephony setup. For a quick start, contact us through the form on the website.







