EdgeSpeech — On-Device Voice AI for React Native — Switchboard Audio SDK | Switchboard Audio SDK
Open navigation menu
← Voice AI Hub / EdgeSpeech
On-Device · React Native · iOS Ready

On-Device Voice
for React Native,
99% cheaper than cloud

EdgeSpeech adds listening, speaking, and voice AI to your apps with a pure JavaScript API. All audio processing runs on-device via the Switchboard SDK — no streaming, no sockets, no cloud audio costs.

99% cheaper

EdgeSpeech on-device vs cloud speech-to-speech API at 1,000 conversations/day.

0 lines of native code

Pure JavaScript API — no C++, no native audio modules, no Xcode or Android Studio setup.

3 on-device ML models

SileroVAD for voice detection, Whisper for transcription, and Sherpa for synthesis — all on-device.

The Problem

Cloud voice AI is ruinously expensive

Traditional voice AI pipelines stream raw audio to the cloud for every conversation. At scale, you're paying to encode, transmit, and transcribe every second of microphone audio — whether the user is speaking or just breathing.

At 1,000 conversations per day (5 minutes each), OpenAI Realtime API costs $3,600/day — that's $1.3M per year just for audio I/O.

  • Continuous audio streaming to cloud servers
  • Round-trip latency degrades the experience
  • Transcript logs create privacy and compliance risk
  • Vendor lock-in: tied to one provider's speech model
  • WebRTC / socket infrastructure required
The Solution

EdgeSpeech: all audio stays on the device

EdgeSpeech runs VAD, STT, and TTS entirely on-device using the Switchboard SDK. Your cloud LLM only ever sees text — a few hundred tokens per turn. Audio never leaves the phone.

At the same scale, EdgeSpeech + text-only LLM costs ~$20/day. That's a 180× cost reduction, plus lower latency and zero audio privacy risk.

  • On-device VAD, STT, and TTS — no audio streaming
  • Works with any LLM (chat pipeline receives text only)
  • Pure JavaScript API — no native audio code
  • No WebRTC, no sockets, no cloud audio infrastructure
  • Works offline — all ML models run locally
Cost Comparison

The numbers don't lie

1,000 conversations/day · 5 minutes each · at scale

OpenAI Realtime API

Cloud Speech-to-Speech

$3,600/day

  • $0.06 / min for audio I/O streaming
  • LLM multimodal tokens billed separately
  • ~$108,000 / month at scale
  • Audio routed through cloud on every call

EdgeSpeech + Text LLM

On-Device Voice AI

~$20/day

  • $0 for STT — Whisper runs on-device
  • $0 for TTS — Sherpa runs on-device
  • Text-only LLM tokens only — ~90% cheaper
  • ~$600 / month at scale — 180× savings

Monthly savings at this scale

$107,400/mo

That’s $1.3M saved annually — redirected into product, headcount, or margin.

Architecture

How it works

EdgeSpeech manages two Switchboard SDK audio graphs. Your JavaScript code sits in the middle — receiving text, calling your LLM, and issuing speak() calls.

Mic
Hardware input
→
SileroVAD
Voice detection
→
Whisper STT
Transcription
→
Your JavaScript
onTranscript event
→
LLM API
Text only (any LLM)
→
speak(text)
JS call
→
Sherpa TTS
Synthesis
→
Speaker
Hardware output
On-device (Switchboard SDK)
Your JavaScript code
Cloud LLM (text only — your choice)

Under the hood — Switchboard SDK audio graphs

Listening Graph

Microphone → MultiChannelToMono → BusSplitter → SileroVAD + Whisper STT

Speaking Graph

Sherpa TTS → Speaker Output

All processing: 16-bit, 16kHz audio, on-device. No intermediate API calls for audio.

Features

Built for developer velocity

Everything you need to ship a production voice AI app — without becoming an audio engineer.

On-device processing

VAD, STT, and TTS run entirely on the device via the Switchboard SDK runtime. No audio ever leaves the phone. Zero privacy risk, zero transcript logs.

JavaScript-only API

initialize(), start(), speak() — that's your entire surface area. No native modules to write, no Xcode builds to debug. Just React Native JavaScript.

Works with any LLM

Your chat pipeline receives plain text. Use OpenAI, Anthropic, Gemini, Llama, or a local Ollama model. No vendor lock-in, no special integration required.

No infrastructure needed

No WebRTC, no audio sockets, no cloud audio pipelines. EdgeSpeech is a React Native library — install it like any other npm package.

Ultra-low latency

Local VAD means transcription starts the moment you stop speaking — no round-trip delays. TTS synthesis begins as soon as your LLM returns the first token.

Barge-in support

onInterrupted event fires when the user speaks while the app is talking. Handle interruptions naturally — pause, listen, and respond. Just like a real conversation.

Quick Start

Up and running in 5 minutes

1

Install the package

npm install @synervoz/edgespeech

2

Initialize with credentials

Get your App ID and Secret from console.switchboard.audio.

3

Listen for transcripts

The onTranscript event fires with text. Pass it to your LLM. Your JavaScript receives text in, and returns text out.

4

Speak the response

Call speak(text) and Sherpa TTS renders audio on-device. No streaming, no buffering — it just plays.

VoiceAgent.js
import {
  initialize, start, speak,
  SwitchboardVoiceModule
} from '@synervoz/edgespeech';

// 1. Initialize with your Switchboard credentials
await initialize('YOUR_APP_ID', 'YOUR_APP_SECRET');

// 2. Listen for final transcripts
SwitchboardVoiceModule.addListener(
  'onTranscript',
  async ({ text, isFinal }) => {
    if (!isFinal) return; // skip partials

    // 3. Send text to your LLM (any provider)
    const reply = await callYourLLM(text);

    // 4. Speak the response on-device
    await speak(reply);
  }
);

// 5. Handle barge-in (user interrupts)
SwitchboardVoiceModule.addListener(
  'onInterrupted',
  () => console.log('User interrupted')
);

// 6. Start listening
await start();
Platforms

Supported platforms

Built for React Native developers. Native audio engine, JavaScript developer experience.

iOS

Supported

iOS 13.4+ required. Fully supported with example app and full documentation available.

React Native

Supported

React Native 0.74+ and Node.js 20+ required. Pure JS API — no Expo ejection needed.

Android

Coming soon

Android support is in active development. API design is platform-agnostic — your code won't change.

Web / Expo

Planned

Web and Expo support is on the roadmap. Follow the GitHub repository for updates.

Ship your voice feature today

The library is on npm, the source is on GitHub, and you'll have a working example running in under 10 minutes.