Can you show the code, if it is simple that will not be too long.
Have a look here
and more precisely to set sample rate:
Sets the preferred sample rate for input and output.
func setPreferredSampleRate(_ sampleRate: Double) throws
The hardware sample rate to use. The available range for hardware sample rate is device dependent. It typically ranges from 8000 through 48000 hertz.
trueif a request was successfully made, or
This method requests a change to the input and output audio sample rate. To see the effect of this change, use the
You can set a preferred sample rate before or after activating the audio session.