summaryrefslogtreecommitdiff
path: root/src/audio.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2016-10-23 14:01:46 +0200
committerJustin Worthe <justin.worthe@gmail.com>2016-10-23 14:01:46 +0200
commit3b264ac05a532828e3ce8c035249903ca0a51ecd (patch)
treef08407e9a56bd406a6753bbb51f29c40f20fdfc3 /src/audio.rs
parent605095f3522bb2111de8dd3b9b2b9474549d9572 (diff)
Changed gui to use xml
Diffstat (limited to 'src/audio.rs')
-rw-r--r--src/audio.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/audio.rs b/src/audio.rs
index df4a933..8f23bed 100644
--- a/src/audio.rs
+++ b/src/audio.rs
@@ -38,7 +38,7 @@ fn get_device_list_returns_devices() {
pub struct OpenRecordingChannel<'a> {
- receiver: Receiver<Vec<f64>>,
+ receiver: Receiver<Vec<f32>>,
stream: pa::Stream<'a, pa::NonBlocking, pa::Input<f32>>
}
@@ -72,7 +72,7 @@ pub fn start_listening<'a>(pa: &'a pa::PortAudio, device_index: u32) -> Result<O
// This callback A callback to pass to the non-blocking stream.
let callback = move |pa::InputStreamCallbackArgs { buffer, .. }| {
- sender.send(buffer.iter().map(|x| *x as f64).collect()).ok();
+ sender.send(buffer.iter().cloned().collect()).ok();
pa::Continue
};
@@ -90,7 +90,7 @@ fn start_listening_returns_successfully() {
let pa = init().expect("Could not init portaudio");
let devices = get_device_list(&pa).expect("Getting devices had an error");
let device = devices.first().expect("Should have at least one device");
- let recording_channel = start_listening(&pa, device.0).expect("Error starting listening to first channel");
+ start_listening(&pa, device.0).expect("Error starting listening to first channel");
}