Having sound issues

Général

STUDIOCRAFTapps

il y a 1 an

I've been trying to fix a problem for few days. My problem is that I keep getting some loud and repetitive ticking sound when both music (from .wav file, gb.sound.play()) and sound effects are playing at the same time (gb.sound.fx()).

The strange thing about it is that the problem happens even if the CPU load is under 100% and/or there's no sound effect playing
If I disable the function that plays sounds effect, the music works fine.

The code isn't worth showing because how simple it is and I've already explained it

Sorunome

NEW il y a 1 an

and/or there's no sound effect playing
If I disable the function that plays sounds effect, the music works fine.

I am confused....is it ticking while the sound effect is playing now or not?

STUDIOCRAFTapps

il y a 1 an

I'm still as confused as you because it's all pretty random but here's what seems to happen

If there were no sound effect playing before the music started and there's currently no sound effect playing: The music works fine
If there were no sound effect playing before the music started and there's currently sound effect playing: [impossible to know]
If there were sound effect playing before the music started and there's currently no sound effect playing: The music works is constantly ticking
If there were sound effect playing before the music started and there's currently sound effect playing: The music works is constantly ticking

STUDIOCRAFTapps

NEW il y a 1 an

Sorunome Sorunome

I'm still as confused as you because it's all pretty random but here's what seems to happen

If there were no sound effect playing before the music started and there's currently no sound effect playing: The music works fine
If there were no sound effect playing before the music started and there's currently sound effect playing: [impossible to know]
If there were sound effect playing before the music started and there's currently no sound effect playing: The music works is constantly ticking
If there were sound effect playing before the music started and there's currently sound effect playing: The music works is constantly ticking

Sorunome

NEW il y a 1 an

Can you post me both the wav and your sound effect so that i can take a closer look?

STUDIOCRAFTapps

il y a 1 an

No need to give you the music because I tryied with multiple other music from other games (including yours) and I still got the same problem. SFX:
const Gamebuino_Meta::Sound_FX BulletS[] = {
  {Gamebuino_Meta::Sound_FX_Wave::NOISE,0,136,-11,0,64,2},
};

STUDIOCRAFTapps

NEW il y a 1 an

Sorunome Sorunome

No need to give you the music because I tryied with multiple other music from other games (including yours) and I still got the same problem. SFX:
const Gamebuino_Meta::Sound_FX BulletS[] = {
  {Gamebuino_Meta::Sound_FX_Wave::NOISE,0,136,-11,0,64,2},
};

Sorunome

NEW il y a 1 an

Unfortunately i am not able to reproduce with any of my WAV files, so i have no idea what is going on :/


EDIT: this is the test sketch i used

#include <Gamebuino-Meta.h>
const Gamebuino_Meta::Sound_FX BulletS[] = {
    {Gamebuino_Meta::Sound_FX_Wave::NOISE,0,136,-11,0,64,2},
};

int8_t track = -1;
void setup() {
    gb.begin();
}

void loop() {
    while(!gb.update());
    
    if (gb.buttons.pressed(BUTTON_A)) {
        if (track == -1) {
            track = gb.sound.play("/reuben3/songs/home2.wav", true);
        } else {
            gb.sound.stop(track);
            track = -1;
        }
    }
    
    if (gb.buttons.pressed(BUTTON_B)) {
        gb.sound.fx(BulletS);
    }
}


STUDIOCRAFTapps

il y a 1 an

try with #define SOUND_BUFFERSIZE 3072

STUDIOCRAFTapps

NEW il y a 1 an

Sorunome Sorunome

try with #define SOUND_BUFFERSIZE 3072

Sorunome

il y a 1 an

Nope, doesn't make any difference. And if that had it would have heavily surprised me

Sorunome

NEW il y a 1 an

STUDIOCRAFTapps STUDIOCRAFTapps

Nope, doesn't make any difference. And if that had it would have heavily surprised me

STUDIOCRAFTapps

il y a 1 an

20fps?

nah

I don't know what's the problem there

STUDIOCRAFTapps

NEW il y a 1 an

Sorunome Sorunome

20fps?

nah

I don't know what's the problem there

Sorunome

il y a 1 an

20fps?

Also tried


EDIT: did you think about that your wav file maybe just has some ticking in it?

Sorunome

NEW il y a 1 an

STUDIOCRAFTapps STUDIOCRAFTapps

20fps?

Also tried


EDIT: did you think about that your wav file maybe just has some ticking in it?

STUDIOCRAFTapps

il y a 1 an

I mentioned that the .wav sound works perfectly if I disabled the sound effect, I can't be the file

STUDIOCRAFTapps

NEW il y a 1 an

Sorunome Sorunome

I mentioned that the .wav sound works perfectly if I disabled the sound effect, I can't be the file

STUDIOCRAFTapps

NEW il y a 1 an

Soo... Has progress been made... maybe?
- When there's a too intense sound problem, I get an hard fault (Error 2)
- It looks like the sound and fx are sharing the same sound channels!

Sorunome

il y a 1 an

- When there's a too intense sound problem, I get an hard fault (Error 2)

That sounds like a completely unrelated issue, like you are running out of RAM or thelike

- It looks like the sound and fx are sharing the same sound channels!

They aren't. FX have their own buffer.

Sorunome

NEW il y a 1 an

STUDIOCRAFTapps STUDIOCRAFTapps

- When there's a too intense sound problem, I get an hard fault (Error 2)

That sounds like a completely unrelated issue, like you are running out of RAM or thelike

- It looks like the sound and fx are sharing the same sound channels!

They aren't. FX have their own buffer.

STUDIOCRAFTapps

il y a 1 an

Ok then I'm stoopid


STUDIOCRAFTapps

il y a 1 an

You can always look at the GitHub repo of the game if you have time (_02_Bitmap.ino, last lines)

STUDIOCRAFTapps

NEW il y a 1 an

Sorunome Sorunome

Ok then I'm stoopid


STUDIOCRAFTapps

NEW il y a 1 an

Sorunome Sorunome

You can always look at the GitHub repo of the game if you have time (_02_Bitmap.ino, last lines)