I tried to add background music to my game using a wav file (8bit, 16kHz). Everything works fine if I load the file like this.
Code: Select all
mmInitDefaultMem( (mm_addr)soundbank_bin );
mmLoadEffect(SFX_QUOD);
mm_sound_effect bgSound = { SFX_QUOD, 1<<10, 0, 200, 127};
mmEffectEx(&bgSound);
Code: Select all
mmInitDefaultMem( (mm_addr)soundbank_bin );
mmLoadEffect(SFX_QUOD);
mm_ds_sample bgSample = {2995, 202533, 0, 1, 1<<9, (void*)&soundbank_bin[SFX_QUOD]};
mm_sound_effect bgSound = { (mm_word)&bgSample, 1<<10, 0, 200, 127};
mmEffectEx(&bgSound);
Thanks in advance.
So long,
Arne
EDIT:
I probably should have seen this coming... The problem was on my side all along. Of course, soundbank_bin[SFX_1] doesn't point to the start of SFX_1 but near the start of the first effect where I had another file with lower volume. -.-
So another question: Is there any way to get the offset of an effect in the soundbank?