Archive 17/01/2023.

SoundSource timeposition

krokodilcapa

Hi!

I would like to ask how much accurate is SoundSource.timePosition? Is it counts the sound starting delay like Unity’s dspTime? Is it capable for rhythm games in its current state?

Modanung

It’s tied into the number of samples processed in SoundSource::Mix:

timePosition_ += (static_cast<float>(samples) / mixRate) * frequency_ / soundStream_->GetFrequency();