imayhaveborkedit / discord-ext-voice-recv

Voice receive extension package for discord.py
https://pypi.org/project/discord-ext-voice-recv/
MIT License
99 stars 15 forks source link

Combined Usage of SilenceGeneratorSink and FFmpegSink #10

Open athphane opened 5 months ago

athphane commented 5 months ago

I'm trying to use this little library of yours to do some audio recording. From my understanding, if the SilenceGeneratorSink is not used, it would write the incoming audio data right next to each other, and not "write" the "dead air" that is there in the conversations. Trying to make the recordings as natural as possible.

I've source dived SilveGeneratorSink and kinda figured it out. I uses 2 skins at the same time in a sense? Then I figured I need the FFmpegSink so that I can actually write out the audio file? But I couldn't figure out how to combine both the SilenceGeneratorSink and FFmpegSink to get this working.

Anyways, I'm here looking for a Hail Mary and ask you if you could provide an example on the usage, or guide me in the proper way to do it.

imayhaveborkedit commented 5 months ago

The silence generator code is a bit bad and broken and needs to be rewritten. All it does is emit silence frames when its not receiving data otherwise. If you do use it, you compose it like so:

SilenceGeneratorSink(FFmpegSink(...))

No guarantees that it'll be accurate if it even works. You have been warned.