0
0

Hi,

Here is my problem:

My sound data comes in chunks a part of a big file and, unfortunately, I don’t know the size of the sound data before this file is completely read. These chunks are parts of one continuous sound and should be smoothly connected together. I need to be able to start playing sound chunks before the file finishes loading.
I was thinking of playing those chunks as separate sounds through a channel with FMOD_CHANNEL_CALLBACK_TYPE_END callback which would start the next sound chunk when the current is finished. But I’m afraid that those transitions would be noticeable.
I also was thinking about using FMOD_SOUND_PCMREADCALLBACK, but it requires for sound data to be in PCM format but my sound can be MP3 data and using this callback will also cause unnecessary data coping.

Could you please give me any suggestion how I can solve this problem in the most efficient way?

Thanks

  • You must to post comments
0
0

FMOD calls this "stitching" – essentially playing multiple sounds back to back seamlessly on a single channel. There’s an example in the downloadable SDK examples – look for a sample with "stitching" in the name (I don’t have it in front of me at the moment). It should show you how to accomplish this.

  • You must to post comments
0
0

[quote="JamesB":bzikqts6]FMOD calls this "stitching" – essentially playing multiple sounds back to back seamlessly on a single channel. There’s an example in the downloadable SDK examples – look for a sample with "stitching" in the name (I don’t have it in front of me at the moment). It should show you how to accomplish this.[/quote:bzikqts6]

It’s realtimestitching

  • You must to post comments
0
0

Thank you very much guys.

This is exactly what I was looking for. But now I stuck with anther problem:

The original "stitching" example works fine, but when I replaced original OGG files with my MP3 samples Sound::setSubSoundSentence method failed with "FMOD error! (25) Unsupported file or audio format." error message. Those MP3 samples work fine if i play them a loan.

Do you have any idea what could cause this error?

Thanks.

  • You must to post comments
0
0

probably because the 2 subsounds are different formats, ie mono vs stereo, or different sample rates. All subsounds must be of the same channel count and frequency.

  • You must to post comments
0
0

This is not the case because in my test environment all samples are copies of the same mp3 file.

Do I need to set any particular flags for the parent and/or child streams?

  • You must to post comments
0
0

I would like to see this test environment because that’s not how setSubSoundSentence works. It -only- returns FMOD_ERR_FORMAT if one of the following happens.

  1. format of subsound 2 and above is different to subsound 1.
  2. channel count of subsound 2 and above is different to subsound 1.

They’re the only 2 checks that ever return that error code in Sound::setSubSoundSentence.

  • You must to post comments
0
0

I have found my mistake. And you right it was incorrect number of channels. The parent sound was created with the exinfo.numchannels set to 1, but my mp3 files had two channels.

Now stitching works fine. Thank you very much for your help.

One more question: Is there any limitation on the size of a child sound? How small could it be?

Thanks

  • You must to post comments
0
0

no there is no limitation but if you have it too small you want be able to poll fast enough to do the double buffer swap.

If you want to play a predetermined list of sounds in a row, dont use the doublebuffertechnique use a larger list and just call playsound on it, with none of the swapping logic in the main loop. Then your subsounds can be as small as they like.

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.