Skip to content

Commit

Permalink
Automatically hook up output to system. (RustAudio#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmedrano authored Nov 18, 2021
1 parent 1c0ed1f commit 90ab9bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/sine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ fn main() {
},
);

// 4. activate the client
// 4. Activate the client. Also connect the ports to the system audio.
let active_client = client.activate_async((), process).unwrap();
active_client
.as_client()
.connect_ports_by_name("rust_jack_sine:sine_out", "system:playback_1")
.unwrap();
active_client
.as_client()
.connect_ports_by_name("rust_jack_sine:sine_out", "system:playback_2")
.unwrap();
// processing starts here

// 5. wait or do some processing while your handler is running in real time.
Expand Down

0 comments on commit 90ab9bd

Please sign in to comment.