How to match Project Audio mix rate and device sample rate

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tiki

Hello
At first ,Thank you for the game engine Godot.
I probably face same problem this Q&A.

Audio mixing rate mismatch causing issues
https://forum.godotengine.org/49702/audio-mixing-rate-mismatch-causing-issues

Mismatch project audiodriver(WASAPI) mix rate and device(windows pc) samplerate
may cause low sound quality.
In fact, I set project audio mix rate 96000Hz(same Windows pc sample rate),
my game sound latency improved.
So I want to match project audio mix rate and device audio driver sample rate on script.
I try this code but not working

ProjectSettings.set_setting("audio/mix_rate", AudioServer.get_mix_rate())

I want to know that how to match Project Audio mix rate and user device audio driver sample rate on gdscript.