Skip to content

Commit

Permalink
Add feature flag to enable wasm for bevy_audio (bevyengine#2397)
Browse files Browse the repository at this point in the history
Exposes Rodio feature flag to enable WASM support.

Note that mp3 doesn't currently work on wasm.
  • Loading branch information
Ixentus authored and ostwilkens committed Jul 27, 2021
1 parent 053194e commit 411611e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ mp3 = ["bevy_internal/mp3"]
vorbis = ["bevy_internal/vorbis"]
wav = ["bevy_internal/wav"]

# WASM support for audio (Currently only works with flac, wav and vorbis. Not with mp3)
wasm_audio = ["bevy_internal/wasm_audio"]

serialize = ["bevy_internal/serialize"]

# Display server protocol support (X11 is enabled by default)
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_audio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ mp3 = ["rodio/mp3"]
flac = ["rodio/flac"]
wav = ["rodio/wav"]
vorbis = ["rodio/vorbis"]
wasm_audio = ["rodio/wasm-bindgen"]
3 changes: 3 additions & 0 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ mp3 = ["bevy_audio/mp3"]
vorbis = ["bevy_audio/vorbis"]
wav = ["bevy_audio/wav"]

# WASM support for audio
wasm_audio = ["bevy_audio/wasm_audio"]

serialize = ["bevy_input/serialize"]

# Display server protocol support (X11 is enabled by default)
Expand Down
1 change: 1 addition & 0 deletions docs/cargo_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
|flac|FLAC audio format support. It's included in bevy_audio feature.|
|wav|WAV audio format support.|
|vorbis|Vorbis audio format support.|
|wasm_audio|WASM audio support. (Currently only works with flac, wav and vorbis. Not with mp3)|
|serialize|Enables serialization of `bevy_input` types.|
|wayland|Enable this to use Wayland display server protocol other than X11.|
|subpixel_glyph_atlas|Enable this to cache glyphs using subpixel accuracy. This increases texture memory usage as each position requires a separate sprite in the glyph atlas, but provide more accurate character spacing.|
Expand Down

0 comments on commit 411611e

Please sign in to comment.