<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/MusicEventIteratorSetEventTime(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@F@MusicEventIteratorSetEventTime"
  },
  "title" : "MusicEventIteratorSetEventTime(_:_:)"
}
-->

# MusicEventIteratorSetEventTime(_:_:)

Sets the timestamp for the event at a music event iterator’s current position.

```
func MusicEventIteratorSetEventTime(_ inIterator: MusicEventIterator, _ inTimeStamp: MusicTimeStamp) -> OSStatus
```

## Parameters

`inIterator`

The music event iterator whose current event you want to change the timestamp of.

`inTimeStamp`

The new timestamp for the event, in beats.

## Return Value

A result code.

## Discussion

After calling this function, the music event iterator remains positioned at the same event. However, because the event has been moved to a new location on the iterator’s music track, the iterator may no longer have a next or previous event. You can test this by calling [`MusicEventIteratorHasPreviousEvent(_:_:)`](/documentation/AudioToolbox/MusicEventIteratorHasPreviousEvent(_:_:)) and [`MusicEventIteratorHasNextEvent(_:_:)`](/documentation/AudioToolbox/MusicEventIteratorHasNextEvent(_:_:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)