0
0

Hi,
I’m having an issue with the FMOD library on Android where reading the final sample of an audio stream appears to restart playback. The same code appears to work fine on iOS.

Relevant code:
kStreamingBufferSize is set to 5121024
mode in the instance I’m seeing is set to FMOD_DEFAULT | FMOD_CREATESTREAM
[code:2s43lf94]
FMOD_CREATESOUNDEXINFO exInfo;
memset(&exInfo, 0, sizeof(exInfo));
exInfo.cbsize = sizeof(exInfo);
exInfo.decodebuffersize = kStreamingBufferSize;
exInfo.initialsoundgroup = reinterpret_cast<FMOD_SOUNDGROUP
>(m_apSoundGroups[audioType]);
FMOD_CALL_CHECKED(m_pSystem->createSound(filename,
mode,
&exInfo,
&spSoundBuffer->pSound),
"FMOD failed to create sound");
[/code:2s43lf94]

Using some overridden file read/seek callbacks I get the following output:
[code:2s43lf94]
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 16384 bytes
[DEBUG] [Audio] Read 6804 bytes
[DEBUG] [Audio] Seeking to 0
[/code:2s43lf94]

After the seek call, the last ~11 seconds of the audio track are skipped and it restarts from the beginning. This behavior is not exhibited on the same code running on iOS. I can post the code of my callbacks if necessary, but I do see the behavior occurring with the default file i/o callbacks as well as my own.

The large buffer size is an attempt at fixing another issue (streaming music skipping on lower resource Android devices), but it appears that the last read sample is either ignored or causes some amount of the track to become ignored. Has anyone else had this issue and know of a workaround or fix?

  • You must to post comments
0
0

Additional notes: I’m seeing this with mp3 files but not ogg files.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.