Add wasm-beep example
This commit is contained in:
parent
cf4e6ca5bf
commit
9dc0c04c95
10 changed files with 6938 additions and 0 deletions
41
examples/wasm-beep/Cargo.toml
Normal file
41
examples/wasm-beep/Cargo.toml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
[package]
|
||||
name = "wasm-beep"
|
||||
description = "cpal beep example for WebAssembly"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[profile.release]
|
||||
# This makes the compiled code faster and smaller, but it makes compiling slower,
|
||||
# so it's only enabled in release mode.
|
||||
lto = true
|
||||
|
||||
[features]
|
||||
# If you uncomment this line, it will enable `wee_alloc`:
|
||||
#default = ["wee_alloc"]
|
||||
|
||||
[dependencies]
|
||||
cpal = { path = "../..", features = ["wasm-bindgen"] }
|
||||
# The `wasm-bindgen` crate provides the bare minimum functionality needed
|
||||
# to interact with JavaScript.
|
||||
wasm-bindgen = "0.2.45"
|
||||
|
||||
# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size
|
||||
# compared to the default allocator's ~10K. However, it is slower than the default
|
||||
# allocator, so it's not enabled by default.
|
||||
wee_alloc = { version = "0.4.2", optional = true }
|
||||
|
||||
# The `web-sys` crate allows you to interact with the various browser APIs,
|
||||
# like the DOM.
|
||||
[dependencies.web-sys]
|
||||
version = "0.3.22"
|
||||
features = ["console"]
|
||||
|
||||
# The `console_error_panic_hook` crate provides better debugging of panics by
|
||||
# logging them with `console.error`. This is great for development, but requires
|
||||
# all the `std::fmt` and `std::panicking` infrastructure, so it's only enabled
|
||||
# in debug mode.
|
||||
[target."cfg(debug_assertions)".dependencies]
|
||||
console_error_panic_hook = "0.1.5"
|
||||
Loading…
Add table
Add a link
Reference in a new issue