[Tweak] TTS perfomance + 7 new voices (#143)
* [Tweak] TTS perfomance * Added 7 new voices * Comment ddr2
This commit is contained in:
@@ -115,7 +115,7 @@ public sealed class TTSSystem : EntitySystem
|
|||||||
private bool TryCreateAudioSource(byte[] data, [NotNullWhen(true)] out IAudioSource? source)
|
private bool TryCreateAudioSource(byte[] data, [NotNullWhen(true)] out IAudioSource? source)
|
||||||
{
|
{
|
||||||
var dataStream = new MemoryStream(data) { Position = 0 };
|
var dataStream = new MemoryStream(data) { Position = 0 };
|
||||||
var audioStream = _audioSystem.LoadAudioWav(dataStream);
|
var audioStream = _audioSystem.LoadAudioOggVorbis(dataStream);
|
||||||
source = _audioSystem.CreateAudioSource(audioStream);
|
source = _audioSystem.CreateAudioSource(audioStream);
|
||||||
if (source == null)
|
if (source == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public sealed class TTSManager
|
|||||||
var reqTime = DateTime.UtcNow;
|
var reqTime = DateTime.UtcNow;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(4));
|
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
|
||||||
var response = await _httpClient.GetAsync(request, cts.Token);
|
var response = await _httpClient.GetAsync(request, cts.Token);
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
@@ -131,6 +131,7 @@ public sealed class TTSManager
|
|||||||
query["pitch"] = body.Pitch;
|
query["pitch"] = body.Pitch;
|
||||||
query["rate"] = body.Rate;
|
query["rate"] = body.Rate;
|
||||||
query["file"] = "1";
|
query["file"] = "1";
|
||||||
|
query["ext"] = "ogg";
|
||||||
uriBuilder.Query = query.ToString();
|
uriBuilder.Query = query.ToString();
|
||||||
return uriBuilder.ToString();
|
return uriBuilder.ToString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,3 +8,10 @@ tts-voice-name-bebey = Бэбэй
|
|||||||
tts-voice-name-biden = Байден
|
tts-voice-name-biden = Байден
|
||||||
tts-voice-name-ddr2 = Ддр 2
|
tts-voice-name-ddr2 = Ддр 2
|
||||||
tts-voice-name-papa = Папич
|
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 = Амина
|
||||||
|
|||||||
@@ -46,14 +46,56 @@
|
|||||||
sex: Male
|
sex: Male
|
||||||
speaker: biden
|
speaker: biden
|
||||||
|
|
||||||
- type: ttsVoice
|
#- type: ttsVoice
|
||||||
id: Ddr2
|
# id: Ddr2
|
||||||
name: tts-voice-name-ddr2
|
# name: tts-voice-name-ddr2
|
||||||
sex: Male
|
# sex: Male
|
||||||
speaker: ddr2
|
# speaker: ddr2
|
||||||
|
|
||||||
- type: ttsVoice
|
- type: ttsVoice
|
||||||
id: Papa
|
id: Papa
|
||||||
name: tts-voice-name-papa
|
name: tts-voice-name-papa
|
||||||
sex: Male
|
sex: Male
|
||||||
speaker: papa
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user