Different volume when using mm_ds_sample
Posted: Sun May 17, 2009 12:11 am
Hi,
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.
But when I use the mm_ds_sample struct to loop it like the following, the volume is hardly a quarter of the original.
Is there something I'm missing like a flag or is this simply supposed to be this way? I looked at the documentation but there is not much on looping, updated to the latest release with no effect and even tried to raise the volume of the file to compensate for this but it is still way too low so any help on this would be appreciated.
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?
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?