Signatures
speak is synchronous and returns the handle immediately. stop is async.Options
Stopping
Saving to a file
Audio also exposes duration.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Turn text into audio
// Get the audio back
final audio = await RunAnywhere.tts.synthesize('Hello from RunAnywhere');
// Play it
final handle = RunAnywhere.tts.speak('Hello from RunAnywhere');
Future<Audio> synthesize(String text, {TtsOptions? options})
Stream<AudioChunk> synthesizeStream(String text, {TtsOptions? options})
SpeechHandle speak(String text, {TtsOptions? options})
Future<void> stop()
Future<List<Voice>> voices()
speak is synchronous and returns the handle immediately. stop is async.final audio = await RunAnywhere.tts.synthesize(
'Hello',
options: TtsOptions(voice: 'en_US-amy-medium', speed: 1.1),
);
| Field | Type | Default |
|---|---|---|
voice | String? | none, model default |
language | String | proto default |
speed | double | proto default |
pitch | double | proto default |
format | AudioFormat | proto default |
sampleRate | int | proto default |
await RunAnywhere.tts.stop();
import 'dart:io';
final audio = await RunAnywhere.tts.synthesize('Save me');
await File('${directory.path}/out.wav').writeAsBytes(audio.samples);
Audio also exposes duration.