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

Playback clipping. #6

Closed
GlenCFL opened this issue Dec 8, 2018 · 5 comments
Closed

Playback clipping. #6

GlenCFL opened this issue Dec 8, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@GlenCFL
Copy link

GlenCFL commented Dec 8, 2018

Making this issue here at the request of @germangb within the issue found here:
RustAudio/rodio#212

MP3 playback of the simple rodio MP3 example seems to be clipping something like a second of audio from the end of the audio stream. This is particularly apparent on short audio clips, with a 1 second duration MP3 not outputting any sound and a 2 second duration MP3 cutting out midway through playback.

This is on Windows 10 x64 compiling using Rust 1.30.1 with the MSVC toolchain.

@germangb germangb added the bug Something isn't working label Dec 8, 2018
@germangb
Copy link
Owner

germangb commented Dec 8, 2018

Hi, thanks for reporting this,

I think we missed an edge case here:

minimp3-rs/src/lib.rs

Lines 75 to 80 in 8459d48

// Keep our buffers full
if self.buffer.len() < REFILL_TRIGGER {
if self.refill()? == 0 {
return Err(Error::Eof);
}
}

If the last audio frame is within the first REFILL_TRIGGER bytes of the buffer, we skip it. I'll publish a new version with a patch

germangb added a commit that referenced this issue Dec 8, 2018
Signed-off-by: german gomez <germangb42@gmail.com>
@germangb
Copy link
Owner

germangb commented Dec 8, 2018

I've pushed the patch 0.3.2 to creates-io. Can you patch rodio to point to it and see if it fixes your issue?

@GlenCFL
Copy link
Author

GlenCFL commented Dec 8, 2018

Sure. Give me a bit and I'll report back.

@GlenCFL
Copy link
Author

GlenCFL commented Dec 8, 2018

The two sounds do work correctly now. Thanks for taking the time out of your day to fix this.

@germangb
Copy link
Owner

germangb commented Dec 8, 2018

Not a problem 🐱 I'll update <RustAudio/rodio#213> with a version bump

@germangb germangb closed this as completed Dec 8, 2018
germangb added a commit that referenced this issue Dec 9, 2018
Signed-off-by: german gomez <germangb42@gmail.com>
@germangb germangb mentioned this issue May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants