Instance Property

currentTime

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

Declaration

var currentTime: TimeInterval { get set }

Discussion

If the sound is playing, currentTime is the offset of the current playback position, measured in seconds from the start of the sound. If the sound is not playing, currentTime is the offset of where playing starts upon calling the play() method, measured in seconds from the start of the sound.

By setting this property you can seek to a specific point in a sound file or implement audio fast-forward and rewind functions.

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 deviceCurrentTime: TimeInterval

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

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.