setVoiceByPath static method

GemError setVoiceByPath(
  1. String path, {
  2. Language? language,
})

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

Also see:

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']);
}