Instance Property

deviceCurrentTime

The time value, in seconds, of the audio output device.

Declaration

var deviceCurrentTime: TimeInterval { get }

Discussion

The value of this property increases monotonically while an audio player is playing or paused.

If more than one audio player is connected to the audio output device, device time continues incrementing as long as at least one of the players is playing or paused.

If the audio output device has no connected audio players that are either playing or paused, device time reverts to 0.

Use this property to indicate “now” when calling the play(atTime:) instance method. By configuring multiple audio players to play at a specified offset from deviceCurrentTime, you can perform precise synchronization—as described in the discussion for that method.

See Also

Managing Information About a Sound

var numberOfChannels: Int

The number of audio channels in the sound associated with the audio player.

var duration: TimeInterval

The total duration, in seconds, of the sound associated with the audio player.

var currentTime: TimeInterval

The playback point, in seconds, within the timeline of the sound associated with the audio player.

var url: URL?

The URL for the sound associated with the audio player.

var data: Data?

The data object containing the sound associated with the audio player.

var currentDevice: String?

The UID of the current audio player.

var format: AVAudioFormat

The format of the audio in the buffer.