реструктуризация файлов, добавление вебчатов

This commit is contained in:
PC1\PTyTb
2025-08-14 10:50:33 +03:00
parent 04b5259737
commit 3ac578b6e6
79 changed files with 10256 additions and 1284 deletions
+86
View File
@@ -0,0 +1,86 @@
unit fTTS;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes,
System.Variants, shellapi,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
FMX.Edit, FMX.ListBox, FMX.Controls.Presentation, uTTS, bass_simple;
type
TfrTTS = class(TFrame)
Label1: TLabel;
cbVoices: TComboBox;
btnUpdateVoices: TButton;
Label2: TLabel;
edtText: TEdit;
Label3: TLabel;
btnSend: TButton;
cbOutput: TComboBox;
procedure btnUpdateVoicesClick(Sender: TObject);
procedure btnSendClick(Sender: TObject);
private
{ Private declarations }
tts: TTTS;
public
{ Public declarations }
end;
implementation
{$R *.fmx}
uses ugeneral;
procedure TfrTTS.btnSendClick(Sender: TObject);
var
s, s1: 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);
try
tts.SetModel(cbVoices.Text);
tts.TextToSpeech(edtText.Text, true);
finally
tts.Free;
end;
end;
1:
begin // SilentPlay
ShellExecute(0, 'open', PChar(myConst.SilentPlay),
PChar(Format('%s %s "%s"', ['2', cbVoices.Text, edtText.Text])), nil, 0);
end;
end;
end;
procedure TfrTTS.btnUpdateVoicesClick(Sender: TObject);
var
s, s1: string;
List: TStringList;
begin
s := ExtractFilePath(ParamStr(0)) + 'piper\piper.exe';
s1 := ExtractFilePath(ParamStr(0)) + 'piper\voices';
tts := TTTS.Create(s, s1);
List := TStringList.Create;
try
cbVoices.Items.Clear;
List := tts.GetModelsList;
cbVoices.Items.Assign(List);
finally
tts.Free;
List.Free;
end;
end;
end.