Add Pascal API for Kokoro TTS 1.0 (#1807)
This commit is contained in:
@@ -82,6 +82,8 @@ type
|
||||
Tokens: AnsiString;
|
||||
DataDir: AnsiString;
|
||||
LengthScale: Single;
|
||||
DictDir: AnsiString;
|
||||
Lexicon: AnsiString;
|
||||
|
||||
function ToString: AnsiString;
|
||||
class operator Initialize({$IFDEF FPC}var{$ELSE}out{$ENDIF} Dest: TSherpaOnnxOfflineTtsKokoroModelConfig);
|
||||
@@ -757,6 +759,8 @@ type
|
||||
Tokens: PAnsiChar;
|
||||
DataDir: PAnsiChar;
|
||||
LengthScale: cfloat;
|
||||
DictDir: PAnsiChar;
|
||||
Lexicon: PAnsiChar;
|
||||
end;
|
||||
|
||||
SherpaOnnxOfflineTtsModelConfig = record
|
||||
@@ -1931,9 +1935,12 @@ begin
|
||||
'Voices := %s, ' +
|
||||
'Tokens := %s, ' +
|
||||
'DataDir := %s, ' +
|
||||
'LengthScale := %.2f' +
|
||||
'LengthScale := %.2f, ' +
|
||||
'DictDir := %s, ' +
|
||||
'Lexicon := %s' +
|
||||
')',
|
||||
[Self.Model, Self.Voices, Self.Tokens, Self.DataDir, Self.LengthScale]);
|
||||
[Self.Model, Self.Voices, Self.Tokens, Self.DataDir, Self.LengthScale,
|
||||
Self.DictDir, Self.Lexicon]);
|
||||
end;
|
||||
|
||||
class operator TSherpaOnnxOfflineTtsKokoroModelConfig.Initialize({$IFDEF FPC}var{$ELSE}out{$ENDIF} Dest: TSherpaOnnxOfflineTtsKokoroModelConfig);
|
||||
@@ -2010,6 +2017,8 @@ begin
|
||||
C.Model.Kokoro.Tokens := PAnsiChar(Config.Model.Kokoro.Tokens);
|
||||
C.Model.Kokoro.DataDir := PAnsiChar(Config.Model.Kokoro.DataDir);
|
||||
C.Model.Kokoro.LengthScale := Config.Model.Kokoro.LengthScale;
|
||||
C.Model.Kokoro.DictDir := PAnsiChar(Config.Model.Kokoro.DictDir);
|
||||
C.Model.Kokoro.Lexicon := PAnsiChar(Config.Model.Kokoro.Lexicon);
|
||||
|
||||
C.Model.NumThreads := Config.Model.NumThreads;
|
||||
C.Model.Provider := PAnsiChar(Config.Model.Provider);
|
||||
|
||||
Reference in New Issue
Block a user