# EdgeSpeech: Local voice processing for React Native

> Source: <https://github.com/switchboard-sdk/EdgeSpeech>
> Published: 2026-07-07 15:22:17+00:00

A React Native hook that provides on-device AI speech processing, completely locally. This can be up to 99% cheaper than cloud speech-to-speech.

| Platform | Status |
|---|---|
| iOS | Supported |
| Android | Coming soon |

``` js
import { EdgeSpeechProvider, useEdgeSpeech } from '@synervoz/edgespeech'

function VoiceChat() {
  const { listen, speak, onTranscriptComplete } = useEdgeSpeech()

  onTranscriptComplete(async (text) => {
    const response = await chat(text)
    await speak(response)
  })

  return <Button onPress={listen} title="Start Listening" />
}

export default function App() {
  return (
    <EdgeSpeechProvider appId="YOUR_APP_ID" appSecret="YOUR_APP_SECRET">
      <VoiceChat />
    </EdgeSpeechProvider>
  )
}
```

Tip

The included [example app](/switchboard-sdk/EdgeSpeech/blob/main/example) shows a complete speech-to-speech workflow.

```
npm install @synervoz/edgespeech
```

| Requirement | Minimum |
|---|---|
| React Native | 0.74+ |
| iOS | 13.4+ |
| Node.js | 22+ |
| expo-modules-core | 2.0.0+ |

Add microphone permission to your `Info.plist`

(or via `app.json`

`infoPlist`

for Expo managed workflow):

```
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for voice input</string>
```

Build your app:

```
npx expo run:ios
```

The `useEdgeSpeech`

hook provides access to the main functions of the Switchboard SDK.

Wrap your app in the `EdgeSpeechProvider`

and configure it.

```
<EdgeSpeechProvider
  appId="YOUR_APP_ID"         // Optional: Switchboard app ID
  appSecret="YOUR_APP_SECRET" // Optional: Switchboard app secret
  sttModel="whisper-base-en"  // Optional: STT model (default: 'whisper-base-en')
  ttsVoice="en_GB"            // Optional: TTS voice (default: 'en_GB')
  vadSensitivity={0.5}        // Optional: VAD sensitivity 0.0–1.0 (default: 0.5)
>
  <App />
</EdgeSpeechProvider>
```

Tip

This library ships with built-in demo credentials so you can run it immediately without creating a Switchboard account.

Note

Your Switchboard `APP_ID`

and `APP_SECRET`

are **safe to bundle in your application**. They function like a publishing key and are intended to be distributed with your app.

Access the state and actions from any component with the `useEdgeSpeech`

hook.

```
const {
  // State
  transcript,              // string       — live interim transcript (clears on final)
  voiceState,              // 'idle' | 'listening' | 'processing' | 'speaking'
  error,                   // string | null
  hasMicrophonePermission, // boolean | null

  // Actions
  listen,                      // () => Promise<void>
  stopListening,               // () => Promise<void>
  speak,                       // (text: string) => Promise<void>
  stopSpeaking,                // () => Promise<void>
  requestMicrophonePermission, // () => Promise<boolean>

  // Callbacks
  onTranscriptComplete, // (cb: (text: string) => void) => void — fires on final transcript
  onInterrupted,        // (cb: () => void) => void — fires when VAD interrupts TTS
} = useEdgeSpeech()
```


