0
0

Hi there,

I’m looking at an issue related to synchronizing streaming sound with on screen action. The issue occurs when I need to change the position of the streaming sound buffer with Channel::setPosition. Obviously some time needs to go by before the buffer is able to be filled with appropriate data after a seek.

I need a way to know when the buffer is ready to play so that I can synchronize it with the visuals. It doesn’t look like the Channel callback functionality delivers this information.

Is there any way to query FMOD for this info?

  • You must to post comments
0
0

Are you using FMOD_NONBLOCKING? If you are not, as soon as your function call to setPosition is complete, the buffer is ready and it will be synchronized.

If you are using FMOD_NONBLOCKING, right now i’d suggest using getPosition and waiting until that value is the same as the value you set with setPosition.

This may change in the future so that the position is actually executed in the fmod nonblocking thread and you would get a callback via FMOD_CREATESOUNDEXINFO but that’s not the way it works at the moment.

  • You must to post comments
0
0

[quote="brett":14w0lz3d]If you are using FMOD_NONBLOCKING, right now i’d suggest using getPosition and waiting until that value is the same as the value you set with setPosition.

This may change in the future so that the position is actually executed in the fmod nonblocking thread and you would get a callback via FMOD_CREATESOUNDEXINFO but that’s not the way it works at the moment.[/quote:14w0lz3d]

Hello Brett,

I ran into this same problem last week (on Xbox360, but not noticable on PC). Your solution works well.

I would recommend putting this information into the help file under both Channel::SetPosition() and the FMOD_NONBLOCKING tutorial. If you change the implementation later, you can always remove the old help.

I was under the mistaken impression that my bug was related to VBR encoding and ACCURATETIME based on the documentation in SetPosition(), but waiting for the seek to complete with GetPosition() solved it completely.

 - Rick
  • You must to post comments
0
0

We had a similar problem on Wii where sound was told to play, and reported that it was playing, but didn’t actually start until a few moments later.

Andrew helped us out by asking: Can you try starting the music event and waiting until getState reports FMOD_EVENT_STATE_CHANNELSACTIVE before commencing the rest of the sound loading?

We put in a check for this Channel Active flag, and by waiting for that to be set, we could then guarantee sync from the stream.

  • You must to post comments
0
0

[quote="mattconnolly":3kb039g3]Andrew helped us out by asking: Can you try starting the music event and waiting until getState reports FMOD_EVENT_STATE_CHANNELSACTIVE before commencing the rest of the sound loading?

We put in a check for this Channel Active flag, and by waiting for that to be set, we could then guarantee sync from the stream.[/quote:3kb039g3]

Hi Matt,

In our case, we are using FMOD Ex directly, without the Event System.

I wonder if a similar test could be constructed using Channel::isPlaying().

Not useful for our particular app, but maybe for somebody else?

   - Rick
  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.