Hi to all,
Currently polishing a project featuring networked devices (local) playing audio in sync, and getting the following behaviour :
Once in a while, a looped clip will skip 40-90 milliseconds, without any evident reason. The clip is short (2-5 seconds), uncompressed, 3d, 44.1khz, generated with AudioClip.Create. Behaviour is extremely random (sometimes it won’t happen in 30 minutes, sometimes 5 times in 10 minutes).
Behaviour frequency varies depending on the device :
iPhone 4 - quite frequent
iPad 1 - rare
iPad 3 - not spotted yet
Not only do I hear the audio skipping ( it goes out of sync with other devices), but am able to measure it using System.Diagnostics.Stopwatch.
For the moment, frequent checks against Stopwatch are used to correct the behaviour when it arises.
Could the garbage collector be the culprit? Any other ideas? It even happens if there’s only one clip looping (well, 2 : a silent 1s click is looping too) and the only visual is a graph of the audio data (drawn with Vectrosity, using OnAudioFilterRead data).
Any help welcome!
Cheers,
Gregzo
Update : I tried simplifying the way I was grabbing data from OnAudioFilterRead to draw it (I had a counter in OnAudioFilterRead, and was grabbing data only if counter%2 == 0, thinking I’d optimize), and haven’t spotted the bug since ( 15 minutes long test, iPhone 4). Will update this post if the behaviour resurfaces.