---
title: SetSampleRate
framework: audiodriverkit
role: symbol
role_heading: Instance Method
path: audiodriverkit/iouseraudioclockdevice/setsamplerate
---

# SetSampleRate

Sets the sample rate for the clock device.

## Declaration

```occ
kern_return_t SetSampleRate(double in_sample_rate);
```

## Parameters

- `in_sample_rate`: The sample rate to set on the clock device.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. For a list of error codes, see Error Codes.

## Discussion

Discussion If successful, changing the sample rate sends a notification to the host to update the object state. This method synchronizes by using the work queue created by the object.

## See Also

### Working with Sample Rates

- [GetSampleRate](audiodriverkit/iouseraudioclockdevice/getsamplerate.md)
- [SetAvailableSampleRates](audiodriverkit/iouseraudioclockdevice/setavailablesamplerates.md)
- [GetAvailableSampleRates](audiodriverkit/iouseraudioclockdevice/getavailablesamplerates.md)
- [GetNumberAvailableSampleRates](audiodriverkit/iouseraudioclockdevice/getnumberavailablesamplerates.md)
