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

Mono ogg files on a different sample rate play through wrong channels with ChannelVolume #252

Open
SpiralP opened this issue Oct 18, 2019 · 2 comments

Comments

@SpiralP
Copy link

SpiralP commented Oct 18, 2019

When playing a mono ogg file that is a different sample rate than your output device's through ChannelVolume the audio switches between the left and right channels. (I think it has to do with compression because it usually happens on the beat of a song)

I've narrowed the issue down to SampleRateConverter's Iterator.next() function, but I don't know much about converting sample rate so I'm lost as to where the problem actually is.

This issue could be related to the lower level decoding library lewton, but since the ogg plays perfectly fine when the sample rates match, I think it's related to SampleRateConverter in rodio.

I found this issue when using Windows 10 with my output sample rate set to 48000 in the sound settings. I was trying to play a 44100 Hz sound through the SpatialSink, which in turn uses ChannelVolume.

Here's a minimal repro-repo: https://github.com/SpiralP/rust-rodio-samplerate-bug

Thanks!

@Cocalus
Copy link
Contributor

Cocalus commented Oct 23, 2019

I fixed some issues like this in #249 which might help but I suspect this is a different issue with the same root cause of generated samples not respecting the number of channels. I suspect Rodio could benefit from switching to using the "sample" crate's Frame trait to avoid this issue at the type level.

@will3942
Copy link
Contributor

@dvdsk Flagging that this issue is affecting us too when resampling from 48kHz to a 44.1kHz OutputDevice for an 8 channel source (or a 6 channel) when using ChannelVolume but probably also on multichannel sources without ChannelVolume.

This may be related to #684

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

3 participants