<!--
{
  "availability" : [
    "DriverKit: 21.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioDriverKit",
  "identifier" : "/documentation/AudioDriverKit/IOUserAudioStream/DeviceSampleRateChanged",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AudioDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserAudioStream@F@DeviceSampleRateChanged#d#"
  },
  "title" : "DeviceSampleRateChanged"
}
-->

# DeviceSampleRateChanged

Updates stream formats, in response to the owning audio device changing its sample rate.

```
kern_return_t DeviceSampleRateChanged(double in_sample_rate);
```

## Parameters

`in_sample_rate`

The new sample rate.

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. For a list of error codes, see <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

## Discussion

This method goes through all the available stream formats and selects the closet format with the matching sample rate.

Calling this method results in a call to the stream’s [`HandleChangeCurrentStreamFormat`](/documentation/AudioDriverKit/IOUserAudioStream/HandleChangeCurrentStreamFormat) to update its format.

---

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)