Raised amount of tries before timeout, convert wav to ogg

This commit is contained in:
EnefFlow
2023-05-08 14:09:05 +03:00
committed by Aviu00
parent 1c3f0c4f0b
commit 5be8c373b4
2 changed files with 3 additions and 2 deletions

View File

@@ -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)
{ {

View File

@@ -21,7 +21,7 @@ public sealed class TTSManager
new HistogramConfiguration() new HistogramConfiguration()
{ {
LabelNames = new[] {"type"}, LabelNames = new[] {"type"},
Buckets = Histogram.ExponentialBuckets(.1, 1.5, 10), Buckets = Histogram.ExponentialBuckets(.1, 1.5, 100),
}); });
private static readonly Counter WantedCount = Metrics.CreateCounter( private static readonly Counter WantedCount = Metrics.CreateCounter(
@@ -130,6 +130,7 @@ public sealed class TTSManager
query["text"] = body.Text; query["text"] = body.Text;
query["pitch"] = body.Pitch; query["pitch"] = body.Pitch;
query["rate"] = body.Rate; query["rate"] = body.Rate;
query["ogg"] = "1";
query["file"] = "1"; query["file"] = "1";
uriBuilder.Query = query.ToString(); uriBuilder.Query = query.ToString();
return uriBuilder.ToString(); return uriBuilder.ToString();