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

# tracks(withMediaCharacteristic:)

Returns tracks that present media of a specified characteristic.

## Declaration

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

## Parameters

- `mediaCharacteristic`: The media characteristic according to which the asset filters its asset tracks. For valid values, see doc://com.apple.avfoundation/documentation/AVFoundation/AVMediaCharacteristic.

## Return Value

Return Value An array of tracks of a specific media characteristic.

## Discussion

Discussion Apple discourages the use of this method in iOS 15, tvOS 15, and macOS 12 or later. Load tracks asynchronously using loadTracks(withMediaCharacteristic:completionHandler:) instead. You may call this method without blocking the current thread after you’ve asynchronously loaded the tracks property.

## See Also

### Accessing tracks

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