Audio.Play() and the annoying problem with delay

I´m building an asset and this needs a play delay about several SAMPLES. Now UNITY is giving me that annoying message in the console:
“Delayed playback via the optional argument of Play is deprecated. Use PlayDelayed instead!” but in PlayDelayed I can only use seconds because:

“This is inconvenient when the engine is running on a different sample rate and the source sound has an even different rate. Working with delays specified in seconds makes this independent of these.”

For what I´m building the point about the sample rate is unimportant to me and I NEED to delay it via samples because many tests showed me that a delay via seconds is very very inaccurate for my purposes.

So how can I avoid this “error” message? Is there even a way to avoid it? What is the UNITY TEAM planning about this? Will it be unavailable in the future so my whole project is dead birth right now?

I’m curious - as always - why is a delay in seconds “very very inaccurate” for you?

Use PlayScheduled instead. PlayDelayed can’t be more accurate than frame rate, hence your trouble… One way to phrase the issue with PlayDelayed is “PlayDelayed, but from which reference time?” That reference time can’t be a stable tick, since it’s the time at which you call the method from the main loop, i.e. framerate dependent.

Thank you gregzo, it works fine with PlayScheduled(). No cracks or other sound “mutations” at the begin and the end of the sounds…