TtsPlatform class abstract
Abstract platform interface for TTS native operations.
This class defines the contract that platform-specific implementations (Android, iOS) must fulfil. It uses PlatformInterface to ensure that only verified implementations can replace the default instance.
The default implementation is MethodChannelTts, which communicates
with native code over a MethodChannel.
- Inheritance
-
- Object
- PlatformInterface
- TtsPlatform
- Implementers
Constructors
- TtsPlatform()
- Constructs a TtsPlatform.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> - Releases native audio buffers and ONNX Runtime resources.
-
generateVoice(
RequestInfo requestInfo) → Future< List> - Runs TTS inference without playing audio.
-
initModels(
String fastSpeechModel, String melganModel, {int version = 1, int threadCount = 1}) → Future< void> - Pre-loads the ONNX model files on the native platform.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
playVoice(
RequestInfo requestInfo) → Future< void> -
Plays a previously generated audio buffer identified by
requestInfo.requestId. -
speakText(
RequestInfo requestInfo) → Future< List> - Runs TTS inference and plays the resulting audio.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ TtsPlatform
-
The default instance of TtsPlatform to use.
getter/setter pair