File tree Expand file tree Collapse file tree
crates/lambda-rs/examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#![ allow( clippy:: needless_return) ]
2+ //! Audio example that plays the bundled "slash" OGG Vorbis fixture.
3+ //!
4+ //! This example validates that `SoundBuffer` decoding and audio output playback
5+ //! can be composed together using only the `lambda-rs` API surface.
26
7+ #[ cfg( all(
8+ feature = "audio-output-device" ,
9+ feature = "audio-sound-buffer-vorbis"
10+ ) ) ]
311use std:: {
412 sync:: {
513 atomic:: {
@@ -11,6 +19,10 @@ use std::{
1119 time:: Duration ,
1220} ;
1321
22+ #[ cfg( all(
23+ feature = "audio-output-device" ,
24+ feature = "audio-sound-buffer-vorbis"
25+ ) ) ]
1426use lambda:: audio:: {
1527 AudioOutputDeviceBuilder ,
1628 SoundBuffer ,
@@ -80,7 +92,10 @@ fn main() {
8092) ) ) ]
8193fn main ( ) {
8294 eprintln ! (
83- "this example requires `audio-output-device` and `audio-sound-buffer-vorbis`"
95+ "This example requires `lambda-rs` features `audio-output-device` and \
96+ `audio-sound-buffer-vorbis`.\n \n \
97+ Run:\n cargo run -p lambda-rs --example play_slash_sound \\ \n \
98+ --features audio-output-device,audio-sound-buffer-vorbis"
8499 ) ;
85100 return ;
86101}
You can’t perform that action at this time.
0 commit comments