summaryrefslogtreecommitdiffhomepage
path: root/tunerdemo.cpp
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2019-02-17 22:10:33 +0100
committerRoland Stigge <stigge@antcom.de>2019-02-17 22:10:33 +0100
commiteac187fcbafcc518185d1074395c5fbe6a7e5aec (patch)
treeb3585f50f9db0a04fd3e5c781eb9f952e39e4a53 /tunerdemo.cpp
parent308a53c389cdc2631860f434989cd57efbf91145 (diff)
Added portaudio support
Diffstat (limited to 'tunerdemo.cpp')
-rw-r--r--tunerdemo.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/tunerdemo.cpp b/tunerdemo.cpp
index e70afb2..9a1f70b 100644
--- a/tunerdemo.cpp
+++ b/tunerdemo.cpp
@@ -1,23 +1,21 @@
#include "tuner.h"
+#include "audioio.h"
+
#include <chrono>
#include <iostream>
#include <thread>
using namespace std::chrono_literals;
-const int sampleFrequency = 44100;
-const int fftSize = 4096;
+int main(int argc, char* argv[]) {
+ RIT::AudioIO audioIO;
-std::vector<std::complex<double>> sample()
-{
- return std::vector<std::complex<double>>(fftSize, 0.0);
-}
+ RIT::Tuner tuner(audioIO.size(), audioIO.sampleFrequency());
-int main(int argc, char* argv[]) {
- RIT::Tuner tuner(fftSize, sampleFrequency);
+ std::cout << "Tuner range: " << tuner.fMin() << " ... " << tuner.fMax() << " Hz" << std::endl;
- std::vector<std::complex<double>> dataIn = sample();
+ std::vector<std::complex<double>> dataIn = audioIO.sample();
while (true) {
auto start = std::chrono::high_resolution_clock::now();