Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio resampling #1

Closed
oleggtro opened this issue Aug 29, 2021 · 4 comments
Closed

audio resampling #1

oleggtro opened this issue Aug 29, 2021 · 4 comments

Comments

@oleggtro
Copy link
Contributor

is there any reason for resampling the audio here? afaik it just causes cpu utilization... In fact why are we touching the audio data at all?

@oleggtro
Copy link
Contributor Author

ok if we don't reencode the audio sounds high pitched and speeded up.

@codetheweb
Copy link
Owner

In theory we should be able to add passthrough: true to the PlayerConfig init struct and pass unmodified OGG / Opus to Songbird (Discord voice library). I was never able to get it to work without having the issue you mention above, but happy to accept a PR if you figure it out. Impact in terms of CPU usage / audio quality seems to be minimal.

@oleggtro
Copy link
Contributor Author

oleggtro commented Sep 7, 2021

i guess the audio speeds up cuz spotify plays back at 44.1khz and discord plays at 48khz. if we don't resample the audio it gets accellerated because discord consumes the data faster than its intended by spotify to be played back. I don't think there is any way around this but maybe its possible to pass a sampling frequency through to songbird...

@oleggtro
Copy link
Contributor Author

Nope, probably not possible, the sampling rate is a constant. It would probably involve major refactoring on songbirds side or just processing it inside of songbird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants