# Detecting Changes to Audio Device/Sample Rate Bug

**URL:** <https://forum.juce.com/t/detecting-changes-to-audio-device-sample-rate-bug/43659>\
**Category:** General JUCE discussion\
**Created:** [January 5, 2021, 3:01pm UTC](https://forum.juce.com/t/detecting-changes-to-audio-device-sample-rate-bug/43659 "2021-01-05T15:01:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dspnorth](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dspnorth](https://forum.juce.com/u/dspnorth)\
**Post date:** [January 5, 2021, 3:01pm UTC](https://forum.juce.com/t/detecting-changes-to-audio-device-sample-rate-bug/43659/1 "2021-01-05T15:01:09Z")

</div>

Hello,

I have a standalone application running on Mac. If I read the outputDeviceName and sampleRate using deviceManager.getAudioDeviceSetup() they are correct when I launch the program.

However, if I change the audio device or sample rate outside of the program while the program is running and check them again they are unchanged. This is a big problem because the sample rate I use to configure my processing does not match the HW sample rate.

I’m constantly calling deviceManager.getAudioDeviceSetup() and checking the outputDeviceName and sampleRate in a timerCallback.

Any ideas? Thank you!

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [April 14, 2021, 3:35pm UTC](https://forum.juce.com/t/detecting-changes-to-audio-device-sample-rate-bug/43659/2 "2021-04-14T15:35:12Z")

</div>

Sorry for the delay in responding.

This issue should be fixed by this commit:

> <https://github.com/juce-framework/JUCE/commit/4cefb3707ce1cec1f648d7b601d8c2f3fa34e3f6>

Please try it out and let us know if the problem persists, or if you run into any new issues.

---

<div class="post-metadata">

**Author:** ![leehu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/leehu/32/3280_2.png) [@leehu](https://forum.juce.com/u/leehu)\
**Post date:** [April 14, 2021, 4:05pm UTC](https://forum.juce.com/t/detecting-changes-to-audio-device-sample-rate-bug/43659/3 "2021-04-14T16:05:31Z")

</div>

Sorry to hijack, but don’t suppose there’s any updates on getting correct sample rate from Logic?

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [April 14, 2021, 4:06pm UTC](https://forum.juce.com/t/detecting-changes-to-audio-device-sample-rate-bug/43659/4 "2021-04-14T16:06:51Z")

</div>

In what context? Is there an existing issue describing the problem?

If not, please can you provide a set of steps (and a code sample if appropriate) which trigger the issue you’re seeing?

---

<div class="post-metadata">

**Author:** ![leehu](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/leehu/32/3280_2.png) [@leehu](https://forum.juce.com/u/leehu)\
**Post date:** [April 14, 2021, 4:08pm UTC](https://forum.juce.com/t/detecting-changes-to-audio-device-sample-rate-bug/43659/5 "2021-04-14T16:08:55Z")

</div>

hi.

> [@Midi AU Fx plugin. Sample Rate from Logic is always 44100](https://forum.juce.com/t/midi-au-fx-plugin-sample-rate-from-logic-is-always-44100/32613/37):
>
> just checked and this is fine on VST, so appears to only be an AU issue.
