Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Changing voice channel throws OperationCancelledException #2748

Open
3 tasks done
josago97 opened this issue Aug 9, 2023 · 0 comments
Open
3 tasks done

[Bug]: Changing voice channel throws OperationCancelledException #2748

josago97 opened this issue Aug 9, 2023 · 0 comments
Labels

Comments

@josago97
Copy link
Contributor

josago97 commented Aug 9, 2023

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • I double checked that I have the required intents.

Description

I've been following the streaming audio library tutorial available here. While the audio streaming, if the bot changes voice channel then the stream is interrupted throwing an OperationCancelledException error. In previous versions this did not happen and was managed correctly.

Version

3.11.0

Working Version

No response

Logs

The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.SemaphoreSlim.d__31.MoveNext()
at Discord.Audio.Streams.BufferedWriteStream.d__22.MoveNext()
at Discord.Audio.Streams.OpusEncodeStream.d__8.MoveNext()
at System.IO.Stream.<g__Core|29_0>d.MoveNext()

Sample

using (var ffmpeg = CreateStream(path))
using (var output = ffmpeg.StandardOutput.BaseStream)
using (var discord = client.CreatePCMStream(AudioApplication.Mixed))
{
    await output.CopyToAsync(discord); // OperationCancelledException here
    await discord.FlushAsync();
}

Packages

NET 6.0

@josago97 josago97 added the bug label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant