expo-voice-flow
v1.0.1
Published
Modern text-to-speech for Expo with high-quality Edge TTS voices
Downloads
369
Maintainers
Readme
expo-voice-flow
Modern text-to-speech for Expo with high-quality Microsoft Edge TTS voices. Free, no API key needed.
Install
npx expo install expo-audio
npm install expo-voice-flowQuick Start
import { useVoiceFlow } from 'expo-voice-flow';
function App() {
const { speak, stop, state } = useVoiceFlow();
return (
<Button
onPress={() => speak({ text: 'Hello world' })}
title={state.speaking ? 'Stop' : 'Speak'}
/>
);
}Features
- Free - No API key, no sign-up, unlimited usage
- 30+ Neural Voices - High-quality Microsoft voices
- Multi-language - English, French, German, Spanish, Japanese, Korean, Chinese
- Cross-platform - iOS, Android, Web
- Audio controls - Play, pause, resume, stop
Available Voices
| Voice | Gender | Language | |-------|--------|----------| | Aria | Female | en-US | | Guy | Male | en-US | | Jenny | Female | en-US | | Davis | Male | en-US | | Sonia | Female | en-GB | | Ryan | Male | en-GB | | Denise | Female | fr-FR | | Katja | Female | de-DE | | Elvira | Female | es-ES | | Nanami | Female | ja-JP | | Xiaoxiao | Female | zh-CN |
Usage
const { speak, pause, resume, stop, voices, state } = useVoiceFlow();
// Basic
speak({ text: 'Hello world' });
// With voice selection
speak({ text: 'Hello', voice: 'en-US-GuyNeural' });
// With speed/pitch
speak({ text: 'Fast speech', rate: 1.5 });
speak({ text: 'Slow speech', rate: 0.7 });
// List voices
voices.forEach(v => console.log(v.FriendlyName, v.Gender));Configuration
import { createVoiceFlow } from 'expo-voice-flow';
createVoiceFlow({
provider: 'edge',
defaultVoice: 'en-US-AriaNeural',
defaultRate: 1.0,
defaultPitch: 1.0,
});API
useVoiceFlow()
Returns { speak, pause, resume, stop, state, voices, loadVoices }
VoiceOptions
| Option | Type | Default | Description | |--------|------|---------|-------------| | text | string | required | Text to speak | | voice | string | 'en-US-AriaNeural' | Voice name | | rate | number | 1.0 | Speed (0.5 - 2.0) | | pitch | number | 1.0 | Pitch (0.5 - 2.0) |
VoiceInfo
| Property | Type | Description | |----------|------|-------------| | ShortName | string | Voice ID (use for voice option) | | FriendlyName | string | Display name | | Gender | string | Male/Female | | Locale | string | Language code |
