0
0

We’re using FMOD on a project. I’m playing an mp3 file from start to finish.

The problem: At specific points in the audio, I have artifacts that sound very peculiar. I’ll try my best to describe:
Not a pop, kinda like a click, but a weird stutter/choke that lasts about 1/4th of a second but is very noticeable. Kind of like "gluk".

That glitch is not on the original mp3 file.

The artifact is there in every playback, at the same spot, and multiple testers have reproduced it.

I open the mp3 to memory and create the sound like this: (pardon the pseudo/objective-c/code)
[code:3cyls7ju]
soundFile = [[NSData alloc] initWithContentsOfFile:@"song.mp3"];
length = [soundFile length];
bytes = (char*)malloc(length);
memcpy(bytes, [soundFile bytes], length);

memset(&info, 0, sizeof(FMOD_CREATESOUNDEXINFO));

info.cbsize = sizeof(info);
info.length = length;

FMOD_RESULT result = FMOD_OK;
result = mpoFMODSystem->createSound(bytes, FMOD_OPENMEMORY, &info, &sound_);[/code:3cyls7ju]

Any help appreciated. I could not find any information or similar case to mine around. Thanks!

  • You must to post comments
0
0

Can you try setting exinfo.suggestedsoundtype to FMOD_SOUND_TYPE_MPEG?

What this will do is switch to using FMODs software MPEG decoder instead of the iOS decoder, I am curious if both produce the same artifact sound.

  • You must to post comments
0
0

Brilliant! Thank you very much.

The artifacts are indeed gone – and I think the sound is cleaner… as if it had a hiss before.

I had tried once setting [i:3dx0owwy]info.format = FMOD_SOUND_FORMAT_MPEG[/i:3dx0owwy], but it made no difference and the artifacts were still there. I didn’t know it was using the iOs decoder.

For reference, my code is now:

[code:3dx0owwy]
soundFile = [[NSData alloc] initWithContentsOfFile:@"song.mp3"];
length = [soundFile length];
bytes = (char*)malloc(length);
memcpy(bytes, [soundFile bytes], length);

memset(&info, 0, sizeof(FMOD_CREATESOUNDEXINFO));

info.cbsize = sizeof(info);
info.length = length;
info.suggestedsoundtype = FMOD_SOUND_TYPE_MPEG; //fixes sound artifacts on decompression

FMOD_RESULT result = FMOD_OK;
result = mpoFMODSystem->createSound(bytes, FMOD_OPENMEMORY, &info, &sound_);[/code:3dx0owwy]

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.