amphineko / moonshard

yet another discord audio bot
MIT License
1 stars 0 forks source link

Motivations, designs and roadmaps #5

Open amphineko opened 2 years ago

amphineko commented 2 years ago

It was a sunny afternoon, and I was trying to make another Discord audio bot, with my favourite C# and dotnet.

The feature set is simple: automatic volume between songs, some additional audio sources like Bilibili and Netease Music, and some features I want but can't recall now. And Discord.Net is the library to use.

Automatic volume adjusting between songs requires some magic on raw audio samples, so I decided to make my own decoding facilities, instead of passing PCM bits to AudioClient by shell executing FFmpeg as suggested in their guide. An FFmpeg library binding is developed to support this.

Thanks to macOS or something else, voice-related features just don't work on my machines, as stated in the issue https://github.com/discord-net/Discord.Net/issues/2275. I ended up making my own Opus encoding and sending encoded packets with my own timing control through RTP connections.

amphineko commented 2 years ago

Let's see if I will finish or abandon the project this time.

Also, I hope I can contribute something to Discord.Net when I get audio-related stuff done here.