I looked over the code and tried a couple things to fix the weird sound issue you're having (weird frequencies instead of foot steps are played).
I couldn't fix the issue, but I've made a few interesting discoveries (Void Linux, x64, using the Mednaffe emulator):
Scenario 1
You don't play any sound in gameInit()
:
//int ch = play_sample(steps_addr, steps_sr);
This leads to the following:
- A weird cracking sound is being played at the start.
- The yay sound becomes the steps sound.
- Whenever you catch a ghost, steps is played (without any reverb). And it's played correct. No weird frequencies whatsoever
- But: no actual foot step sounds while walking, though.
Scenario 2
You play yay in gameInit()
:
int ch = play_sample(yay_addr, yay_sr); // after yay has been initialized
This leads to the following:
- A weird cracking sound is being played at the start instead of yay.
- The foot steps are actually playing while walking!
- But: they're played only once and you have to stop and start moving to hear them again (which is probably a completely different issue I guess).
- Also: A different kind of weird (and high) frequencies are played seemingly randomly OR after a specific/random amount time during which no other sound is playing (maybe even only after playing steps at least once, don't know for sure).
- Also: Same as Scenario 1, steps is played whenever you catch a ghost without any reverb.
Scenario 3
You play victory in gameInit()
:
int ch = play_sample(victory_addr, victory_sr); // after victory has been initialized
This leads to Scenario 2 again.
Conclusion
My guess is that either your mechanism for loading the sounds (VAG_Header
struct + upload_sample()
) or your mechanism for playing the sounds is not implemented as it should be. I'll test more and keep this issue updated when I can.