---
title: "tracks(withMediaCharacteristic:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablemovie/tracks(withmediacharacteristic:)"
---

# tracks(withMediaCharacteristic:)

Retrieve tracks in the movie that present media of the specified characteristic.

## Declaration

```swift
func tracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) -> [AVMutableMovieTrack]
```

## Parameters

- `mediaCharacteristic`: The media characteristic of the tracks to return.

## Return Value

Return Value An array of tracks, which is empty if there are no tracks with the media characteristic.

## Discussion

Discussion Apple discourages using this method in iOS 15, tvOS 15, macOS 12, and watchOS 8 or later. Load tracks asynchronously using loadTracks(withMediaCharacteristic:completionHandler:) instead.

## See Also

### Accessing tracks

- [tracks](avfoundation/avmutablemovie/tracks.md)
- [track(withTrackID:)](avfoundation/avmutablemovie/track(withtrackid:).md)
- [tracks(withMediaType:)](avfoundation/avmutablemovie/tracks(withmediatype:).md)
- [unusedTrackID()](avfoundation/avmutablemovie/unusedtrackid().md)
