瀏覽代碼

Change test to use f32 data to demonstrate using f32 samples decoded from i16 wav file.

mitchmindtree 8 年之前
父節點
當前提交
98761a4b9a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      examples/wav.rs

+ 2 - 2
examples/wav.rs

@@ -29,10 +29,10 @@ fn run() -> Result<(), pa::Error> {
     // Initialise PortAudio and create an output stream.
     let pa = try!(pa::PortAudio::new());
     let settings = 
-        try!(pa.default_output_stream_settings::<i16>(CHANNELS, SAMPLE_RATE, FRAMES_PER_BUFFER));
+        try!(pa.default_output_stream_settings::<f32>(CHANNELS, SAMPLE_RATE, FRAMES_PER_BUFFER));
 
     let callback = move |pa::OutputStreamCallbackArgs { buffer, .. }| {
-        let buffer: &mut [[i16; CHANNELS as usize]] =
+        let buffer: &mut [[f32; CHANNELS as usize]] =
             sample::slice::to_frame_slice_mut(buffer).unwrap();
         sample::slice::equilibrium(buffer);