AVAudioPlayer.PlayAtTime(Double) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Begins playback at a certain delay, relative to the current playback time.
[Foundation.Export("playAtTime:")]
public virtual bool PlayAtTime (double time);
abstract member PlayAtTime : double -> bool
override this.PlayAtTime : double -> bool
Parameters
- time
- Double
Returns
- Attributes
Remarks
The value of time
must be greater than or equal to the DeviceCurrentTime property (use CurrentTime to move the playhead back in time, if necessary).
Multiple AVAudioPlayers can be synchronized using this method:
var shortStartDelay = 0.01;
var now = player.DeviceCurrentTime;
player.PlayAtTime(now + shortStartDelay);
player2.PlayAtTime(now + shortStartDelay);