Голоса перенесены в AppData

This commit is contained in:
PC1\PTyTb
2025-09-12 14:01:24 +03:00
parent 0aac56e6e1
commit a82ed4c39f
10 changed files with 349 additions and 79 deletions
+14 -6
View File
@@ -18,10 +18,12 @@ type
Label3: TLabel;
btnSend: TButton;
cbOutput: TComboBox;
btnGetVoices: TButton;
procedure btnUpdateVoicesClick(Sender: TObject);
procedure btnSendClick(Sender: TObject);
procedure cbVoicesChange(Sender: TObject);
procedure cbOutputChange(Sender: TObject);
procedure btnGetVoicesClick(Sender: TObject);
private
{ Private declarations }
tts: TTTS;
@@ -34,19 +36,26 @@ implementation
{$R *.fmx}
uses ugeneral;
procedure TfrTTS.btnGetVoicesClick(Sender: TObject);
begin
ShellExecute(0, 'open', pwidechar(ExtractFilePath(myConst.VoicesPath)),
nil, nil, 1);
ShellExecute(0, 'open', pwidechar('https://huggingface.co/rhasspy/piper-voices/tree/v1.0.0'),
nil, nil, 1);
end;
procedure TfrTTS.btnSendClick(Sender: TObject);
var
s, s1: string;
s: string;
begin
case cbOutput.ItemIndex of
0:
begin // this
s := ExtractFilePath(ParamStr(0)) + 'piper\piper.exe';
s1 := ExtractFilePath(ParamStr(0)) + 'piper\voices';
if cbVoices.ItemIndex = -1 then
exit;
tts := TTTS.Create(s, s1);
tts := TTTS.Create(s, myConst.VoicesPath);
try
tts.SetModel(cbVoices.Text);
tts.TextToSpeech(edtText.Text, true);
@@ -67,13 +76,12 @@ end;
procedure TfrTTS.btnUpdateVoicesClick(Sender: TObject);
var
s, s1: string;
s: string;
List: TStringList;
begin
s := ExtractFilePath(ParamStr(0)) + 'piper\piper.exe';
s1 := ExtractFilePath(ParamStr(0)) + 'piper\voices';
tts := TTTS.Create(s, s1);
tts := TTTS.Create(s, myConst.VoicesPath);
List := TStringList.Create;
try
cbVoices.Items.Clear;