Skip to content

Commit

Permalink
fix channel_volume example to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineGod committed Dec 4, 2024
1 parent 1591e2a commit 75f9f92
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
53 changes: 27 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/channel_volume.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use rodio::source::ChannelVolume;

fn main() {
let (_stream, handle) = rodio::OutputStream::try_default().unwrap();
let sink = rodio::Sink::try_new(&handle).unwrap();
let stream_handle = rodio::OutputStreamBuilder::open_default_stream().unwrap();
let sink = rodio::Sink::connect_new(&stream_handle.mixer());

let input = rodio::source::SineWave::new(440.0);
let chan_vol = ChannelVolume::new(input, vec![0.01, 0.01, 0.0, 0.0, 0.0, 0.0]);
let chan_vol = ChannelVolume::new(input, vec![0.01, 0.0, 0.1, 0.1, 0.1, 0.5]);
sink.append(chan_vol);

sink.sleep_until_end();
Expand Down

0 comments on commit 75f9f92

Please sign in to comment.