Skip to content

Commit 0f059bd

Browse files
committed
add more doc around Empty
1 parent 5f5a84f commit 0f059bd

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

examples/channel_volume.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ fn main() {
66
let (_stream, handle) = rodio::OutputStream::try_default().unwrap();
77
let sink = rodio::Sink::try_new(&handle).unwrap();
88

9-
let file = std::fs::File::open("assets/music.ogg").unwrap();
10-
let input = rodio::Decoder::new(BufReader::new(file)).unwrap();
11-
// let input = rodio::source::SineWave::new(440.0);
9+
// let file = std::fs::File::open("assets/music.ogg").unwrap();
10+
// let input = rodio::Decoder::new(BufReader::new(file)).unwrap();
11+
let input = rodio::source::SineWave::new(440.0);
1212
let chan_vol = ChannelVolume::new(input, vec![0.01, 0.01, 0.0, 0.0, 0.0, 0.0]);
1313
sink.append(chan_vol);
1414

src/source/empty.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ use std::time::Duration;
44
use crate::{Sample, Source};
55

66
/// An empty source.
7+
///
8+
/// The empty source is special in that it will never return any data.
9+
/// It also reports 0 channels, a sample rate of 0, and a Duration of 0.
710
#[derive(Debug, Copy, Clone)]
811
pub struct Empty<S>(PhantomData<S>);
912

src/stream.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ impl CpalDeviceExt for cpal::Device {
216216
&format.config(),
217217
move |data, _| {
218218
data.iter_mut()
219-
.for_each(|d| *d = mixer_rx.next().unwrap_or(0f32));
220-
dbg!(&data[0..6]);
219+
.for_each(|d| *d = mixer_rx.next().unwrap_or(0f32))
221220
},
222221
error_callback,
223222
None,

0 commit comments

Comments
 (0)