imayhaveborkedit / discord-ext-voice-recv

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

Combined Usage of SilenceGeneratorSink and FFmpegSink #10

Open athphane opened 7 months ago

athphane commented 7 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 7 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.