Kokoro class
Core Kokoro TTS engine for Flutter
Constructors
- Kokoro(KokoroConfig config)
- Creates a new Kokoro TTS engine
Properties
-
availableVoices
→ Map<
String, Voice> -
Gets the map of available voices
no setter
- config → KokoroConfig
-
The configuration for this Kokoro instance
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createTTS(
{required String text, required dynamic voice, double speed = 1.0, String lang = 'en-us', bool isPhonemes = false, bool trim = true}) → Future< TtsResult> - Creates audio from the provided text using the specified voice and settings
-
createTTSStream(
{required String text, required dynamic voice, double speed = 1.0, String lang = 'en-us', bool isPhonemes = false, bool trim = true}) → Stream< TtsResult> - Stream audio generation for longer texts
-
dispose(
) → Future< void> - Close resources used by the TTS engine
-
ensureInitialized(
) → Future< void> - Ensures the Kokoro engine is initialized
-
getVoice(
String id) → Voice? - Get a specific voice by ID
-
getVoices(
) → List< String> - Get a list of available voice IDs
-
initialize(
) → Future< void> - Initialize the Kokoro TTS engine
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited