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 glitch after internal resampling #2320

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Closed

audio glitch after internal resampling #2320

SDLBugzilla opened this issue Feb 11, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: don't know
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2016-12-05 12:34:29 +0000, Sylvain wrote:

Created attachment 2647
sound

Since audio converter code https://hg.libsdl.org/SDL/rev/bb99dede0675
There is a glitch after playing attached wav sound file.

Some log:
Build format 8010->8010, channels 1->2, rate 48000->22050

On 2016-12-14 13:38:44 +0000, Sylvain wrote:

Ryan,

I think there may be an issue when downsampling (and also upsampling),
I would apply this patch (and the same for upsampling):

--- a/src/audio/SDL_audiotypecvt.c Tue Dec 13 00:22:42 2016 -0500
+++ b/src/audio/SDL_audiotypecvt.c Wed Dec 14 14:37:06 2016 +0100
@@ -283,11 +283,11 @@
SDL_memcpy(last_sample, src, cpy);

 while (dst < target) {
  •    src += 8;
    
  •    src += channels;
       eps += dstsize;
       if ((eps << 1) >= srcsize) {
           SDL_memcpy(dst, sample, cpy);
    
  •        dst += 8;
    
  •        dst += channels;
           for (i = 0; i < channels; i++) {
               sample[i] = (float) ((((double) src[i]) + ((double) last_sample[i])) * 0.5);
           }
    

On 2016-12-17 21:16:20 +0000, Ryan C. Gordon wrote:

Whoops, sorry! This is fixed now in https://hg.libsdl.org/SDL/rev/f6cd81aab88e !

--ryan.

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

1 participant