Memory Leak #97723
Unanswered
NoahCxrest
asked this question in
General
Memory Leak
#97723
Replies: 1 comment 9 replies
-
Description: while (!stoppingToken.IsCancellationRequested && !disposed)
{
Thread.Sleep(100);
try
{
int read = originStream.Read(buffer, 0, 48000);
bufferedByteStream.Write(buffer, 0, read);
}
catch (IOException ex) when (ex.InnerException is SocketException { SocketErrorCode: SocketError.ConnectionReset })
{
Console.WriteLine("Connection was forcibly closed by the remote host.");
bufferedByteStream.Close();
disposed = true;
}
} Context:
Additional Information:
Code Snippet for Reference: // ... (previous code)
using (SpeechRecognitionEngine engine = SREBuilder.Create(new[] { "1FriendlyDoge", "notanoob600m", "RoyalCrests" }))
{
engine.SpeechRecognized += (sender, e) => HandleSpeechRecognized(sender, e, userId, guildId);
engine.SetInputToAudioStream(bufferedByteStream, new SpeechAudioFormatInfo(EncodingFormat.Pcm, 48000, 16, 2, 192000, 4, null));
engine.RecognizeAsync(RecognizeMode.Multiple);
while (!stoppingToken.IsCancellationRequested && !disposed)
{
Thread.Sleep(100);
try
{
int read = originStream.Read(buffer, 0, 48000);
bufferedByteStream.Write(buffer, 0, read);
}
catch (IOException ex) when (ex.InnerException is SocketException { SocketErrorCode: SocketError.ConnectionReset })
{
Console.WriteLine("Connection was forcibly closed by the remote host.");
bufferedByteStream.Close();
disposed = true;
}
}
} |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, quick question: is there a known memory leak with Microsoft.Speech.Recognition && System.Speech.Recognition?
I seem to be having an issue with a memory leak and have isolated it, profiled it, and confirmed that the memory leak wasn’t caused by my code.
Will provide code if necessary! This is more of a question for if there’s a known issue pertaining to this.
Beta Was this translation helpful? Give feedback.
All reactions