<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetricKit",
  "identifier" : "/documentation/MetricKit/TotalBackgroundAudioTimeMetric",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "MetricKit"
    ],
    "preciseIdentifier" : "s:9MetricKit024TotalBackgroundAudioTimeA0V"
  },
  "title" : "TotalBackgroundAudioTimeMetric"
}
-->

# TotalBackgroundAudioTimeMetric

A metric that measures the total time the app spent in the background playing audio.

```
struct TotalBackgroundAudioTimeMetric
```

## Discussion

This metric corresponds to the [`MetricResult.totalBackgroundAudioTime(_:)`](/documentation/MetricKit/MetricResult/totalBackgroundAudioTime(_:)) case. It appears in both [`intervalEntries`](/documentation/MetricKit/MetricReport/intervalEntries) and [`stateEntries`](/documentation/MetricKit/MetricReport/stateEntries) when state reporting is enabled.

## Topics

### Measurements

[`let value: Measurement<UnitDuration>`](/documentation/MetricKit/TotalBackgroundAudioTimeMetric/value)

The total time the app is in the background and playing audio.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Encodable`](/documentation/Swift/Encodable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)