# Setting sampleRate with AudioDeviceSetup

**URL:** <https://forum.juce.com/t/setting-samplerate-with-audiodevicesetup/13368>\
**Category:** General JUCE discussion\
**Created:** [August 14, 2014, 11:26pm UTC](https://forum.juce.com/t/setting-samplerate-with-audiodevicesetup/13368 "2014-08-14T23:26:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [August 14, 2014, 11:26pm UTC](https://forum.juce.com/t/setting-samplerate-with-audiodevicesetup/13368/1 "2014-08-14T23:26:09Z")

</div>

Having problems setting a different sampleRate from default 44100.&nbsp;

&nbsp;

my code: &nbsp;

```
AudioDeviceManager::AudioDeviceSetup deviceSetup = AudioDeviceManager::AudioDeviceSetup();

    deviceSetup.sampleRate = 8192;

    deviceManager.initialise (2, 2, 0, true, String::empty, &deviceSetup);
    
  

    log->writeToLog(String(deviceSetup.sampleRate));

    log->writeToLog(String(deviceManager.getCurrentAudioDevice()->getCurrentSampleRate()));
```

Gives me&nbsp;

```
8192

44100
```

&nbsp;

Maybe I'm missing something here?&nbsp;

---

<div class="post-metadata">

**Author:** ![andrewj](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/andrewj/32/13428_2.png) [@andrewj](https://forum.juce.com/u/andrewj)\
**Post date:** [August 15, 2014, 7:35am UTC](https://forum.juce.com/t/setting-samplerate-with-audiodevicesetup/13368/2 "2014-08-15T07:35:37Z")

</div>

That's an odd looking sample rate, maybe your device doesn't support it and the code drops back to 44100.

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [August 15, 2014, 8:55am UTC](https://forum.juce.com/t/setting-samplerate-with-audiodevicesetup/13368/3 "2014-08-15T08:55:07Z")

</div>

I also tried 11025 and 22050 and got similar results, however trying at 48000 (which I know my audio device supports) worked fine. I had not made&nbsp;the link between audio device support and sample rate.&nbsp;

Is there a way to 'force' an AudioCallback&nbsp;to sample the audio input at a certain rate, a division of the default, for the purpose of processing incoming audio? I'm working on some pitch detection functionality and I don't need the audio to be coming in at 44100, 11025 is more than sufficient most of the time.&nbsp;&nbsp;

Thanks
