| 127 | } |
| 128 | |
| 129 | void InputAnalyzer::printBinInfo( int mouseX ) |
| 130 | { |
| 131 | size_t numBins = mMonitorSpectralNode->getFftSize() / 2; |
| 132 | size_t bin = std::min( numBins - 1, size_t( ( numBins * ( mouseX - mSpectrumPlot.getBounds().x1 ) ) / mSpectrumPlot.getBounds().getWidth() ) ); |
| 133 | |
| 134 | float binFreqWidth = mMonitorSpectralNode->getFreqForBin( 1 ) - mMonitorSpectralNode->getFreqForBin( 0 ); |
| 135 | float freq = mMonitorSpectralNode->getFreqForBin( bin ); |
| 136 | float mag = audio::linearToDecibel( mMagSpectrum[bin] ); |
| 137 | |
| 138 | console() << "bin: " << bin << ", freqency (hertz): " << freq << " - " << freq + binFreqWidth << ", magnitude (decibels): " << mag << endl; |
| 139 | } |
| 140 | |
| 141 | CINDER_APP( InputAnalyzer, RendererGl( RendererGl::Options().msaa( 8 ) ) ) |
nothing calls this directly
no test coverage detected