Skip to content

Commit

Permalink
Rebasing on main.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocinon committed Oct 22, 2024
1 parent fed407f commit b44389f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public async Task StartTextToSpeechAsync(Voice voice, Func<VoiceClip, Task> part

var parameters = new Dictionary<string, string>
{
{ ModelIdParameter, model?.Id ?? Model.MonoLingualV1.Id },
{ ModelIdParameter, model?.Id ?? Model.EnglishV1.Id },
{ OutputFormatParameter, outputFormat.ToString().ToLower() }
};

Expand Down Expand Up @@ -219,6 +219,10 @@ await client.WebSocketClient.CloseAsync(WebSocketCloseStatus.NormalClosure, stri
}
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
finally
{
client.ReinitializeWebSocketClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public sealed class TextToSpeechWebSocketRequest
/// <exception cref="ArgumentNullException">Thrown when <paramref name="text" /> is null or empty.</exception>
public TextToSpeechWebSocketRequest(string text, bool? flush = null, bool tryTriggerGeneration = false)
{
if (string.IsNullOrWhiteSpace(text))
{
throw new ArgumentNullException(nameof(text));
}

// if the last character of the text is not a space, append one
Text = text[^1] != ' ' ? text + ' ' : text;
TryTriggerGeneration = tryTriggerGeneration;
Expand Down

0 comments on commit b44389f

Please sign in to comment.