solaluset / DandelionMusic

Discord music bot written in Python that supports YouTube, SoundCloud, Spotify, Bandcamp, Twitter and custom files
GNU General Public License v3.0
42 stars 17 forks source link

Bad sound quality #63

Closed StonebanksYT closed 8 months ago

StonebanksYT commented 1 year ago

The sound quality is very poor now. Any fixes? The audio is distorted and not stereo at all.

solaluset commented 1 year ago

Please share the link which causes this. Also check the settings of your voice channel, you may need to set bigger bitrate.

(does discord support stereo at all?)

EDIT: seems like it does for bots

StonebanksYT commented 1 year ago

Every song is distorted and unclear now. It's not the bitrate I've checked. Yeah it does support stereo and in earlier versions the quality was clear and much better than current audio quality. Edit: can it have something to do with the hosting website?

solaluset commented 1 year ago

The hosting doesn't matter that much, but if it uses shared IPs YouTube may restrict access to good quality. The part of the bot which does sound processing wasn't changed in recent updates (you can check with earlier versions, results should be the same), so it should be an external problem. Try to run it on different machine and let me know if that helps.

TransitNode commented 1 year ago

I have the exact same issue, sound quality is very bad no matter the audio source, discord channel bitrate.

I speculate the PCM audio format might cause performance issues, maybe a switch to FFmpegOpusAudio would be of benefit. PCM is already encoding to the Opus format anyway and using the FFmpegOpusAudio would produce Opus packets directly.

https://discordpy.readthedocs.io/en/stable/api.html#ffmpegopusaudio

solaluset commented 1 year ago

Converting to PCM surely introduces some overhead, but:

I still think that this issue is caused by YouTube. To help me identify it you can:

StonebanksYT commented 1 year ago

the bot is not working at all now. Error 403 or sm

solaluset commented 1 year ago

the bot is not working at all now. Error 403 or sm

403 means forbidden. YouTube is restricting you.

I've published a new release with updated requirements, it may solve this issue. Try it out. If it doesn't help, please share info described above.

StonebanksYT commented 1 year ago

the bot is not working at all now. Error 403 or sm

403 means forbidden. YouTube is restricting you.

I've published a new release with updated requirements, it may solve this issue. Try it out. If it doesn't help, please share info described above.

Yea downloaded the new version..the bot is working but the sound quality is like the previous version..volume is fluctuating and song is not clear..dont even know if its just me or what

solaluset commented 1 year ago

How are you listening to it, btw? Do you use a phone or PC, speakers or headphones?

StonebanksYT commented 1 year ago

How are you listening to it, btw? Do you use a phone or PC, speakers or headphones?

I have stereo headphones and the bot's sound quality was fine a month ago I guess, that's when the hosting website changed their node to a new big node with dynamic IP but I'm sure the sound quality dropped after I switched to the new node of my hosting website. You earlier mentioned that if it uses shared ip then YouTube may cause issues. Can that be a problem? I will debug this using local hosting and then check the quality and I'll comment later

solaluset commented 8 months ago

@StonebanksYT is there any new info on this?

StonebanksYT commented 8 months ago

The sound quality is fine now I just checked. Closing this issue