Skip to content

Commit 632f007

Browse files
committed
[update] example to not rely on audio if the feature is not defined (Will fix in a later PR).
1 parent df7697f commit 632f007

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

crates/lambda-rs/examples/play_slash_sound.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
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+
))]
311
use 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+
))]
1426
use lambda::audio::{
1527
AudioOutputDeviceBuilder,
1628
SoundBuffer,
@@ -80,7 +92,10 @@ fn main() {
8092
)))]
8193
fn 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
}

0 commit comments

Comments
 (0)