Skip to content

Commit 2d02586

Browse files
committed
[add] symphonia and initial implementation.
1 parent 7895a17 commit 2d02586

5 files changed

Lines changed: 135 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 111 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/lambda-rs-platform/Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ wgpu = { version = "=28.0.0", optional = true, features = ["wgsl", "spirv"] }
2323
pollster = { version = "=0.4.0", optional = true }
2424
lambda-rs-logging = { path = "../lambda-rs-logging", version = "2023.1.30" }
2525
cpal = { version = "=0.17.1", optional = true }
26+
symphonia = { version = "=0.5.5", optional = true, default-features = false, features = [
27+
"ogg",
28+
"vorbis",
29+
"wav",
30+
"pcm",
31+
] }
2632

2733
# Force windows crate to 0.62 to unify wgpu-hal and gpu-allocator dependencies.
2834
# Both crates support this version range, but Cargo may resolve to different
@@ -53,7 +59,9 @@ wgpu-with-gl = ["wgpu", "wgpu/webgl"]
5359
# ---------------------------------- AUDIO ------------------------------------
5460

5561
# Umbrella features (disabled by default)
56-
audio = ["audio-device"]
62+
audio = ["audio-device", "audio-decode-wav", "audio-decode-vorbis"]
5763

5864
# Granular feature flags (disabled by default)
5965
audio-device = ["dep:cpal"]
66+
audio-decode-wav = ["dep:symphonia"]
67+
audio-decode-vorbis = ["dep:symphonia"]

crates/lambda-rs-platform/src/audio/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
88
#[cfg(feature = "audio-device")]
99
pub mod cpal;
10+
11+
#[cfg(any(feature = "audio-decode-wav", feature = "audio-decode-vorbis"))]
12+
pub mod symphonia;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#![allow(clippy::needless_return)]
2+
3+
//! `symphonia` dependency wrapper.
4+
//!
5+
//! This module will provide WAV and OGG Vorbis decode helpers for `lambda-rs`.
6+
//! It is intentionally internal and MAY change between releases.

crates/lambda-rs-platform/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ pub mod shader;
1616
pub mod wgpu;
1717
pub mod winit;
1818

19-
#[cfg(feature = "audio-device")]
19+
#[cfg(any(
20+
feature = "audio",
21+
feature = "audio-device",
22+
feature = "audio-decode-wav",
23+
feature = "audio-decode-vorbis"
24+
))]
2025
pub mod audio;

0 commit comments

Comments
 (0)