Skip to content

Commit ce53291

Browse files
committed
fixed silent frames
1 parent 7618cdb commit ce53291

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Discord.Net.WebSocket/Audio/Streams/OpusEncodeStream.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ public async Task WriteSilentFramesAsync()
4141

4242
// The rest of the array is already zeroes, so no need to fill the rest.
4343

44-
const int frameCount = 5;
44+
// Discard any remaining partial frame.
45+
_partialFramePos = 0;
46+
47+
const int frameCount = 5; // Discord specifically asks for 5 frames.
4548
for (int i = 0; i < frameCount; i += 1)
4649
{
4750
await WriteAsync(frameBytes, 0, frameBytes.Length).ConfigureAwait(false);

0 commit comments

Comments
 (0)