This commit is contained in:
owenchen committed 2026-06-22 17:02:26 +08:00
1 parent 77a62b8d88
commit 2c6475b2d5
10 files changed
+341 -234

No files matched your search

+15 -9
View File
@@ -1,4 +1,5 @@
using CloudBuilder.Core.DatabaseAccessor.Entity;
using CloudBuilder.AI.Policy;
using CloudBuilder.Core.DatabaseAccessor.Entity;
using CloudBuilder.Core.DependencyInjection.Task;
using CloudBuilder.Topshelf.Python;
using CloudBuilder.Topshelf.Utility;
@@ -17,18 +18,23 @@ namespace CloudBuilder.Topshelf.Task
public void Run(Dictionary<string, string> bodyDict)
{
Python39Command python39Command = new Python39Command(service);
//Python39Command python39Command = new Python39Command(service);
try
{
SoVITS soVITS = new SoVITS(python39Command);
Array voiceArray = Enum.GetValues(typeof(SoVITSTtsVoice));
//SoVITS soVITS = new SoVITS(python39Command);
//Array voiceArray = Enum.GetValues(typeof(SoVITSTtsVoice));
foreach (SoVITSTtsVoice voice in voiceArray)
//foreach (SoVITSTtsVoice voice in voiceArray)
//{
// soVITS.Generate("三更时分,青龙城毫无征兆地被血色浓雾笼罩,雾气带着诡异的幻术气息,城中低阶修士尽数陷入昏睡.", soVITS.Voices[voice], $"F:\\GPT-SoVITS\\gen\\{(int)voice}.mp3");
//}
Array voices = Enum.GetValues(typeof(ChineseTtsVoice));
foreach (ChineseTtsVoice voice in voices)
{
soVITS.Generate("三更时分,青龙城毫无征兆地被血色浓雾笼罩,雾气带着诡异的幻术气息,城中低阶修士尽数陷入昏睡.", soVITS.Voices[voice], $"F:\\GPT-SoVITS\\gen{(int)voice}.mp3");
SaveAudioToFileHelper.AudioToFile(voice, 1.0f, "三更时分,青龙城毫无征兆地被血色浓雾笼罩,雾气带着诡异的幻术气息,城中低阶修士尽数陷入昏睡.", $"F:\\GPT-SoVITS\\gen\\{(int)voice}.mp3");
}
}
catch (Exception ex)
{
@@ -36,7 +42,7 @@ namespace CloudBuilder.Topshelf.Task
}
finally
{
python39Command.Dispose();
//python39Command.Dispose();
}
return;