Problem with sending voice through ffmpeg(spamming Sent Speaking)
See original GitHub issueIm sending audio using ffmpeg(ffmpeg version N-93129-g9e1e521393
) and Discord.Net(Discord.Net 2.0.2-dev-01059
).
I’m sending audio from local .mp3 using ffmpeg with methods like below.
When i’m sending first time from connection to voice channel - it is all ok.
For the next times bot spamming Sent Speaking and his “circle” in discord is blinking.
private Process CreateStream(string path)
{
return Process.Start(new ProcessStartInfo
{
FileName = "ffmpeg",
Arguments = $"-hide_banner -loglevel panic -i \"{path}\" -ac 2 -f s16le -ar 48000 pipe:1",
UseShellExecute = false,
RedirectStandardOutput = true,
});
}
using (var ffmpeg = CreateStream(path))
using (var output = ffmpeg.StandardOutput.BaseStream)
using (var discord = AudioClient.CreatePCMStream(AudioApplication.Mixed))
{
try
{
IsSending = true;
await AudioClient.SetSpeakingAsync(true);//just try to fix
await output.CopyToAsync(discord, _token);//_token to stop sending audio
return true;
}
catch (OperationCanceledException)
{
return true;
}
finally
{
await discord.FlushAsync();
await AudioClient.SetSpeakingAsync(false);//just try to fix
IsSending = false;
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Reduce background noise and optimize the speech from ...
Reduce background noise and optimize the speech from an audio clip using ffmpeg ... I extract audio clips from a video file for...
Read more >In Praise of FFmpeg - Slashdot
It took a complex problem and solved it, with free software. The book is now closed on multimedia: ffmpeg is the solution to...
Read more >Optimize audio files for Speech-to-Text
Play audio and video files using FFMPEG. Extract, transcode, and convert audio file properties using FFMPEG. Run Speech-to-Text on a variety of sample...
Read more >20+ FFmpeg Commands For Beginners
This guide lists the most commonly and frequently used 20+ ffmpeg commands. These commands are just enough to getting started with FFmpeg.
Read more >javascript - How to Play Audio File Into Channel?
Have Discord.js installed in VS. From there the steps are quite simple. After making your project index.js you will start typing some code ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have this issue as well. To work around it, I had to create the PCM stream once and re-use it every time. That’s the only solution I’ve found until this gets resolved.
still have problem.