-
-
Notifications
You must be signed in to change notification settings - Fork 736
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
When IAudioClient ConnectAsync is created, null is returned #2803
Comments
sorry for the code repetition, I suck at writing github questions. |
Formatted for the sake of everyone. |
I can't reproduce this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to broadcast audio via ffmpeg and after I create a connection to a voice channel, IAudioClient is assigned null because of which I can't broadcast audio.
` public async Task JoinChannel(SocketMessage msg, string URL, IVoiceChannel? channel = null)
{
channel ??= (msg.Author as IGuildUser)?.VoiceChannel;
if (channel == null) { await msg.Channel.SendMessageAsync("Пользователь должен находиться в голосовом канале."); return; }
try
{
using (var ffmpeg = CreateStream(URL))
using (var output = ffmpeg.StandardOutput.BaseStream)
{
AudioOutStream audioClient;
audioClient = channel.ConnectAsync(false, false, true).Result.CreatePCMStream(AudioApplication.Music);
try
{
await output.CopyToAsync(audioClient);
}
finally
{
await audioClient.FlushAsync();
}
}
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
`
The text was updated successfully, but these errors were encountered: