summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2017-08-12 19:59:29 +0200
committerJustin Worthe <justin@worthe-it.co.za>2017-08-12 19:59:29 +0200
commitd23fae9da3da625ca87c615a7798570f138aa0f5 (patch)
tree61e4f0fc8555abcd6482ada9c66950430cfd83c9
parent9ff484e2e462d613a3e4746d000e1b0c8f3bd7a1 (diff)
parent88dc9f058bfc40b56372c0e22983b0b979ad964b (diff)
Merge branch 'master' of github.com:JWorthe/rusty_microphone
-rw-r--r--README.org7
-rw-r--r--src/gui.rs3
2 files changed, 10 insertions, 0 deletions
diff --git a/README.org b/README.org
index e2e47af..1639d09 100644
--- a/README.org
+++ b/README.org
@@ -40,6 +40,13 @@ like so:
apt-get install libgtk-3-bin libgtk-3-dev libpango1.0-0
#+END_SRC
+On Fedora
+
+#+BEGIN_SRC sh
+yum install gtk3-devel portaudio-devel
+#+END_SRC
+
+
** Compiling and running
To compile the project:
diff --git a/src/gui.rs b/src/gui.rs
index 3b2bfab..796b341 100644
--- a/src/gui.rs
+++ b/src/gui.rs
@@ -163,6 +163,9 @@ fn start_listening_current_dropdown_value(dropdown: &gtk::ComboBoxText, mic_send
fn start_processing_audio(mic_receiver: Receiver<Vec<f32>>, cross_thread_state: Arc<RwLock<CrossThreadState>>) {
thread::spawn(move || {
while let Ok(samples) = mic_receiver.recv() {
+ //just in case we hit performance difficulties, clear out the channel
+ while mic_receiver.try_recv().ok() != None {}
+
let signal = ::transforms::align_to_rising_edge(&samples);
let correlation = ::transforms::correlation(&samples);
let fundamental = ::transforms::find_fundamental_frequency_correlation(&samples, ::audio::SAMPLE_RATE);