0
0

I’m using FMOD Ex v4.2.10 but when playing back MP3 files, just as they end I hear a series of rapid clicks lasting about 1 second. I’ve tried several different mp3 files and they all show the same behaviour.

I can reproduce this with just the following steps.

1) Download a fresh install of FMOD Ex.
2) Change \examples\loadfrommemory\main.c to use “wave.mp3” instead of “swish.wav”.
3) Compile and run.

Note that it doesn’t seem to matter whether it’s the loadfrommemory or playsound example files, nor whether the sample is created with FMOD_HARDWARE or FMOD_SOFTWARE (i.e. replacing “swish.wav” specificially, isn’t important).

I’m using a Realtek AC’97 Audio sound card on Win XP.

Can you let me know if I need to do something special for MP3 playback (i.e. just changing the loadfrommemory to use mp3 files isn’t enough), or if this is a bug. Just let me know if you need any more information.

  • You must to post comments
0
0

Hi Brett,

Thanks for your reply. Unfortunately I’m not so sure it’s as simple as this. I’ve tried the built executable on several boxes now (including desktops as well as laptops) with a variety of sound cards / drivers but they all exhibit exactly the same problem – just at the end of wave.mp3 there are 3 loud clicks within about a second.

I agree however that the (lack of) difference between the hardware / software decoding is suspicous though!

I’ll keep tweaking the parameters to see if I can find some combination to make it go away, but any pointers you could suggest would be gratefully received.

Additionally, would it be possible to send you directly any extra information (say the C file I’m using or perhaps the compiled exe) to run on your system to see if it reproduces there – perhaps there’s something going wrong with the compilation or the code that’s driving the DLL rather than the library itself?

  • You must to post comments
0
0

Hi again,

I’ve now found the key difference that’s causing the problem – it’s whether the data is loaded as a file (which works) or from memory (which doesn’t).

For example, the following code will produce the clicks when the resulting sound is played:

[quote:3986fs8v]
void LoadSound(char *memory, int length)
{
FMOD_CREATESOUNDEXINFO exinfo;

memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.length = length;

lretcode = FMOD_System_CreateSound(m_FMODSystem, (const char *)memory, FMOD_HARDWARE | FMOD_OPENMEMORY, &exinfo, &sound);
}
[/quote:3986fs8v]

but this code doesn’t (when called with exactly the same values for memory and length):

[quote:3986fs8v]
void LoadSound(char *memory, int length)
{
FILE *lpf;

lpf = fopen(“$temp.mp3″,”wb”);
fwrite(memory,1,length,lpf);
fclose(lpf);

lretcode = FMOD_System_CreateSound(m_FMODSystem, “$temp.mp3”, FMOD_HARDWARE, 0, &sound);
}
[/quote:3986fs8v]

I assume that the FMODEx DLL must be doing something different when on the two code paths – can you have a look at this and let me know if there’s a bug or if I’m calling FMOD_System_CreateSound incorrectly?

  • You must to post comments
0
0

[quote="brett":16o0lrv3]I can only assume there is something wrong with the memory block you passed in.[/quote:16o0lrv3]

That’s what I first thought too! However, as you can see from the second example block of code above, which I wrote specifically in that way to show it wasn’t that, it’s definitely not the block of memory itself that’s causing the problem (because if I dump the memory block to file, it then load it as a file, it works).

It may still be that the bug lies in the drivers if you just pass the filename or pointer to the memory block into the driver. However, if you are loading the file from the filename and always passing in the memory block into the driver then that’s surprising.

Perhaps the problem is that when the driver is getting samples from the file an EOF is returned at the end, but when getting samples from the memory block something else is returned and it’s that difference that’s causing the problem. If that was the case, then it could be that the bug exists on all systems, but only on a few of them will there be an audible difference (depending on the robustness of the drivers to what FMOD is passing it)?

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.