Fixed TTS using StreamElements. Fixed several issues.
This commit is contained in:
@@ -82,35 +82,36 @@ namespace TwitchChatTTS.Hermes.Socket
|
||||
|
||||
public override async Task Connect()
|
||||
{
|
||||
_rwls.EnterWriteLock();
|
||||
_rwls.EnterReadLock();
|
||||
try
|
||||
{
|
||||
if (Connected)
|
||||
return;
|
||||
|
||||
_logger.Debug($"Attempting to connect to {URL}");
|
||||
await ConnectAsync(URL);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_rwls.ExitWriteLock();
|
||||
_rwls.ExitReadLock();
|
||||
}
|
||||
|
||||
_logger.Debug($"Attempting to connect to {URL}");
|
||||
await ConnectAsync(URL);
|
||||
|
||||
}
|
||||
|
||||
private async Task Disconnect()
|
||||
{
|
||||
_rwls.EnterWriteLock();
|
||||
_rwls.EnterReadLock();
|
||||
try
|
||||
{
|
||||
if (!Connected)
|
||||
return;
|
||||
|
||||
await DisconnectAsync(new SocketDisconnectionEventArgs("Normal disconnection", "Disconnection was executed"));
|
||||
}
|
||||
finally
|
||||
{
|
||||
_rwls.ExitWriteLock();
|
||||
_rwls.ExitReadLock();
|
||||
}
|
||||
|
||||
await DisconnectAsync(new SocketDisconnectionEventArgs("Normal disconnection", "Disconnection was executed"));
|
||||
}
|
||||
|
||||
public async Task CreateTTSVoice(string voiceName)
|
||||
@@ -437,13 +438,13 @@ namespace TwitchChatTTS.Hermes.Socket
|
||||
_logger.Warning("Tom to Speech websocket client is not connected. Not sending a message.");
|
||||
return;
|
||||
}
|
||||
|
||||
await base.Send(opcode, message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_rwls.ExitReadLock();
|
||||
}
|
||||
|
||||
await base.Send(opcode, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user