summaryrefslogtreecommitdiff
path: root/src/gui.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2016-10-13 18:07:21 +0200
committerJustin Worthe <justin.worthe@gmail.com>2016-10-13 18:07:21 +0200
commite6cbba66fed669c9c6808584a4f1551cfdb5de30 (patch)
tree4b218ac7ed0c6c24f249df357b924b198827dfb3 /src/gui.rs
parentb37f7697c100d7f89054c57d8108ee64902865eb (diff)
Function to start listening on microphone
Messy. To clean up once I've seen if it works.
Diffstat (limited to 'src/gui.rs')
-rw-r--r--src/gui.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui.rs b/src/gui.rs
index 66ae1f7..de8a322 100644
--- a/src/gui.rs
+++ b/src/gui.rs
@@ -8,7 +8,8 @@ pub fn start_gui() -> Result<(), String> {
let window = gtk::Window::new(gtk::WindowType::Toplevel);
window.set_title("Musician Training");
- let audio_devices = try!(::audio::get_device_list().map_err(|e| e.to_string()));
+ let pa = ::audio::init().expect("Could not init portaudio");
+ let audio_devices = try!(::audio::get_device_list(&pa).map_err(|e| e.to_string()));
let dropdown = gtk::ComboBoxText::new();
for (index, name) in audio_devices {
dropdown.append(Some(format!("{}", index).as_ref()), name.as_ref());