[Tweak] TTS perfomance + 7 new voices (#143)

* [Tweak] TTS perfomance

* Added 7 new voices

* Comment ddr2
This commit is contained in:
HitPanda
2023-06-18 22:07:52 +03:00
committed by Aviu00
parent 184cd637f4
commit 9a1db8d551
4 changed files with 57 additions and 7 deletions

View File

@@ -115,7 +115,7 @@ public sealed class TTSSystem : EntitySystem
private bool TryCreateAudioSource(byte[] data, [NotNullWhen(true)] out IAudioSource? source)
{
var dataStream = new MemoryStream(data) { Position = 0 };
var audioStream = _audioSystem.LoadAudioWav(dataStream);
var audioStream = _audioSystem.LoadAudioOggVorbis(dataStream);
source = _audioSystem.CreateAudioSource(audioStream);
if (source == null)
{

View File

@@ -86,7 +86,7 @@ public sealed class TTSManager
var reqTime = DateTime.UtcNow;
try
{
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(4));
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
var response = await _httpClient.GetAsync(request, cts.Token);
if (!response.IsSuccessStatusCode)
{
@@ -131,6 +131,7 @@ public sealed class TTSManager
query["pitch"] = body.Pitch;
query["rate"] = body.Rate;
query["file"] = "1";
query["ext"] = "ogg";
uriBuilder.Query = query.ToString();
return uriBuilder.ToString();
}

View File

@@ -8,3 +8,10 @@ tts-voice-name-bebey = Бэбэй
tts-voice-name-biden = Байден
tts-voice-name-ddr2 = Ддр 2
tts-voice-name-papa = Папич
tts-voice-name-mykyta = Микита
tts-voice-name-glados = Гладос
tts-voice-name-sentrybot = Сентрибот
tts-voice-name-mana = Мана
tts-voice-name-soldier = Солдат
tts-voice-name-planya = Планя
tts-voice-name-amina = Амина

View File

@@ -46,14 +46,56 @@
sex: Male
speaker: biden
- type: ttsVoice
id: Ddr2
name: tts-voice-name-ddr2
sex: Male
speaker: ddr2
#- type: ttsVoice
# id: Ddr2
# name: tts-voice-name-ddr2
# sex: Male
# speaker: ddr2
- type: ttsVoice
id: Papa
name: tts-voice-name-papa
sex: Male
speaker: papa
- type: ttsVoice
id: Mykyta
name: tts-voice-name-mykyta
sex: Male
speaker: mykyta
- type: ttsVoice
id: Glados
name: tts-voice-name-glados
sex: Female
speaker: glados
- type: ttsVoice
id: Sentrybot
name: tts-voice-name-sentrybot
sex: Male
speaker: sentrybot
- type: ttsVoice
id: Mana
name: tts-voice-name-mana
sex: Female
speaker: mana
- type: ttsVoice
id: Soldier
name: tts-voice-name-soldier
sex: Male
speaker: soldier
- type: ttsVoice
id: Planya
name: tts-voice-name-planya
sex: Female
speaker: planya
- type: ttsVoice
id: Amina
name: tts-voice-name-amina
sex: Female
speaker: amina