Audiosource.time "sluggish" on Android with .wav file imported from www.audioClip

Hello! I’m working on a rythyhm game for Android where players can import their own songs with their beatmaps made on another program (for PC) that i’ve made. However i’ve encountered a big problem.

For easier importing in Android with the www class, i made it so the PC beatmap maker program exports the song as .wav files. However, in Android the song imports and sounds just fine, but when i try to get the current song time with Audiosource.time, the value gets updated in a “sluggish” way, with small intervals of time before it gets updated to the song time.

This causes the “rythym icons” in my game to move as if they were lagging and also causes their timing (dependant on the current song time) to be messed up and makes the game pretty much unplayable.

This isn’t a problem with sound files that i include directly into the Unity APK build (Audiosource.time works perfectly with those). Is there anything i can try? Any help is appreciated! :slight_smile:

You shouldn’t be using Audiosource.time if you require accuracy anyway.
You should be using timeSamples instead. Doubt that’s the problem you are referring to, but you should still change it.

I’m indeed using timeSamples/audioSource.clip.frequency to get the time right now, but the problem is still the same.

I also tried using a manual timer with Time.deltaTime but it was too inacurate and also made the game unplayable.