il y a 6 ans
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
NEW il y a 6 ans
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 6 ans
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
NEW il y a 6 ans
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
NEW il y a 6 ans
Can you post me both the wav and your sound effect so that i can take a closer look?
NEW il y a 6 ans
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},
};
NEW il y a 6 ans
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); } }
NEW il y a 6 ans
try with #define SOUND_BUFFERSIZE 3072
NEW il y a 6 ans
20fps?
nah
I don't know what's the problem there
NEW il y a 6 ans
I mentioned that the .wav sound works perfectly if I disabled the sound effect, I can't be the file
NEW il y a 6 ans
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!
NEW il y a 6 ans
- 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.
NEW il y a 6 ans
You can always look at the GitHub repo of the game if you have time (_02_Bitmap.ino, last lines)