Get write position for sound buffer

Hi!
I’m reworking a part of an old sound engine code, that is using DirectSound API. It forms sound data into packets, which are queued by DSBuffer class. Data is then written into DirectSound buffer by getting offset into it with IDirectSoundBuffer::GetCurrentPosition() function. This function returns current ‘play position’ as well as ‘write position’, that marks a " safe position to write new data".

I was wondering, whether I can replicate such behavior with FMOD. Can someone suggest, how to get such ‘safe’ position for fmod sound object? I’ve only seen Channel::getPosition() function, that returns current play position. Should I track a valid write position myself?

Would be grateful for any help.

Hi,

An option may be tracking the playback position yourself. We do have an example of this in our C# examples but would still work in C++ here: Unity Integration | Scripting Examples - Video Playback.

Hope this helps!