# AudioInput Proccesing

**URL:** <https://forum.juce.com/t/audioinput-proccesing/23921>\
**Category:** General JUCE discussion\
**Created:** [August 27, 2017, 6:04pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921 "2017-08-27T18:04:12Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evvy](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Evvy](https://forum.juce.com/u/Evvy)\
**Post date:** [August 27, 2017, 6:04pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/1 "2017-08-27T18:04:12Z")

</div>

hi there, i am new in Juce and want to learn about DSP  
can i get source C++ to :

1. get audio input from mic
2. and how to process the audio input with FFT ?
3. how to showing frequency audio input in gui ?

I try to build tuner so someone please help me to understand Juce ☹  
for windows thx

---

<div class="post-metadata">

**Author:** ![holy-city](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@holy-city](https://forum.juce.com/u/holy-city)\
**Post date:** [August 27, 2017, 7:22pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/2 "2017-08-27T19:22:33Z")

</div>

Look at the example projects, especially the SimpleFFT example. You may need to pull the latest tip on the develop branch from GitHub, I know that project was broken on the main branch.

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [August 28, 2017, 12:44pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/3 "2017-08-28T12:44:55Z")

</div>

FFT might not be the best way of doing a tuner though. I think there’s a recommended auto-correlation method…

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [August 28, 2017, 12:46pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/4 "2017-08-28T12:46:07Z")

</div>

In fact Id break up what you are trying to do here.

Start by trying to get a meter showing the current level on the UI. That’ll be a less painful introduction than writing a tuner. You can then turn it into a tuner later.

---

<div class="post-metadata">

**Author:** ![Evvy](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Evvy](https://forum.juce.com/u/Evvy)\
**Post date:** [August 31, 2017, 5:15pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/5 "2017-08-31T17:15:58Z")

</div>

thank you 🙂 can you tell me how to get signal / audio from mic ?

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [August 31, 2017, 5:17pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/6 "2017-08-31T17:17:39Z")

</div>

Are you doing a plugin for a DAW application like Cubase or Reaper, or are you doing a standalone application?

---

<div class="post-metadata">

**Author:** ![Evvy](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Evvy](https://forum.juce.com/u/Evvy)\
**Post date:** [August 31, 2017, 5:18pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/7 "2017-08-31T17:18:27Z")

</div>

thank you 🙂 i will try  
can u tell me how to get signal/audio form mic ?

---

<div class="post-metadata">

**Author:** ![Evvy](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Evvy](https://forum.juce.com/u/Evvy)\
**Post date:** [August 31, 2017, 5:19pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/8 "2017-08-31T17:19:38Z")

</div>

plugin for a DAW

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [August 31, 2017, 5:21pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/9 "2017-08-31T17:21:39Z")

</div>

The audio to process will be delivered into your plugin with the processBlock method. You need to set up your DAW application to send audio from your microphone into the plugin, it’s not the plugin’s job to deal with that.

---

<div class="post-metadata">

**Author:** ![Evvy](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Evvy](https://forum.juce.com/u/Evvy)\
**Post date:** [August 31, 2017, 5:27pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/10 "2017-08-31T17:27:32Z")

</div>

☹ Wow thank you so much  
is it possible to equalize the input signal?  
FYI i try to make the tuner in real time

---

<div class="post-metadata">

**Author:** ![Evvy](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@Evvy](https://forum.juce.com/u/Evvy)\
**Post date:** [August 31, 2017, 5:30pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/11 "2017-08-31T17:30:59Z")

</div>

i have a task to process the signal with FFT so inevitably i should try using FFT for tuner, please give me the reason why FFT can not be used to make the tuner? thanks a lot

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [August 31, 2017, 6:52pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/12 "2017-08-31T18:52:05Z")

</div>

I suspect it’s not easy to make it accurate. It’s not like you get a frequency bin for every note, especially at the bass end. I think there’s a way using the phase of the bins…but I never looked into it.

This might help:

[https://dsp.stackexchange.com/questions/1317/is-there-an-algorithm-for-finding-a-frequency-without-dft-or-fft](https://dsp.stackexchange.com/questions/1317/is-there-an-algorithm-for-finding-a-frequency-without-dft-or-fft)

---

<div class="post-metadata">

**Author:** ![holy-city](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@holy-city](https://forum.juce.com/u/holy-city)\
**Post date:** [August 31, 2017, 7:30pm UTC](https://forum.juce.com/t/audioinput-proccesing/23921/13 "2017-08-31T19:30:35Z")

</div>

The FFT takes N samples and spits out the magnitude and phase information (as a complex number) into N “bins.” That means you have a frequency resolution of Fs/N. So for a full range audio tuner, you need to decide your resolution by picking the lowest note (say, A-1 which has a frequency of 27.5Hz), and 1 cent around there which is about 0.016Hz. If your sample rate is 44.1kHz, that means your minimum fft size (N) is 2,756,250 samples. Which is prohibitively large just from the computation, and that would be a latency of about 62.5 seconds (need to wait that long to collect that many samples). So obviously that’s a no go.

What you’re looking for is a real time pitch detection algorithm. There are a number of methods just a Google search away, many of which use the FFT or the autocorrelation of a signal, which can be computed with an FFT.
