<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAudioTypes",
  "identifier" : "/documentation/CoreAudioTypes/AudioStreamBasicDescription/mBitsPerChannel",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Audio Types"
    ],
    "preciseIdentifier" : "c:@S@AudioStreamBasicDescription@FI@mBitsPerChannel"
  },
  "title" : "mBitsPerChannel"
}
-->

# mBitsPerChannel

The number of bits for one audio sample.

```
var mBitsPerChannel: UInt32
```

## Discussion

For example, for linear PCM audio using the [`kAudioFormatFlagsCanonical`](/documentation/CoreAudioTypes/kAudioFormatFlagsCanonical) format flags, calculate the number of bits as follows:

```swift
mBitsPerChannel = 8 * sizeof(AudioSampleType);
```

Set the number of bits to `0` for compressed formats.

---

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)