setVoiceByPath static method
Sets the TTS/computer voice by absolute file path.
Providing language helps the SDK choose the best matching voice when
interacting with platform TTS capabilities.
Parameters
path: absolute path to the voice file.language: optional Language to guide voice selection.
Returns
- GemError: GemError.success on success, otherwise an error code.
Also see:
- setTTSVoiceByLanguage - Set the TTS voice by language.
- getVoice - Get the currently selected voice.
Implementation
static GemError setVoiceByPath(String path, {Language? language}) {
final OperationResult resultString = staticMethod(
'SdkSettings',
'setVoiceByPath',
args: <String, dynamic>{
'filePath': path,
'lang': language ?? Language(name: 'noLang'),
},
);
return GemErrorExtension.fromCode(resultString['result']);
}