Time to get list of WASAPI devices on my machine (5 devices in total) before change:
Input devices: 12 ms, output devices: 187 ms
After change:
Input devices: 1 ms, output devices: 1 ms
* Bump to version 0.12.
* Fix some cargo clippy lints.
* Partially revert temp_buffer_to_data to be closer to original.
* Suppress too many arguments lint.
## Description
This PR migrates the wasm example from an npm/webpack based approach to [trunk](https://trunkrs.dev/). Fixes#834.
Of note:
the `console_error_panic_hook` dependency was gated in `Cargo.toml` via `[target."cfg(debug_assertions)".dependencies]`. This is documented as nonfunctional and will throw a warning on build:
```
warning: Found `debug_assertions` in `target.'cfg(...)'.dependencies`.
This value is not supported for selecting dependencies and will not work as expected.
To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies
```
Since the actual usage of `console_error_panic_hook` is *also* gated in `lib.rs` behind `#[cfg(debug_assertions)]` it didn't make sense to have the cargo gate in place, hence I have removed it.
## Next steps
If this PR is merged, the [wiki page](https://github.com/RustAudio/cpal/wiki/Setting-up-a-new-CPAL-WASM-project) linked in the root README should be updated as well.
The standard library is using a similar implementation to parking_lot now. Other than APIs that are unstable, there shouldn't be that much of a reason to rely on parking_lot anymore. Parts of the cpal codebase already are using std locks. This PR removes the remaining parking_lot uses and replaces them with the standard library's.
* update actions/checkout to v4
other checkout
* switch actions-rs/toolchain to dtolnay/rust-toolchain
* stop using actions-rs/cargo
* stop using actions-rs/clippy-check
* update mymindstorm/setup-emsdk and don't use an old version of emscripten
* update katyo/publish-crates
* Make build script more robust
* Make build dependencies available regardless of target
* Fix error about the u32 i32 type mismatch
* Update readme
* Fix target_arch bug
Replace assert in WASAPI WAVEFORMTEX supported format check with bubbled error message.
For our use case, this stops a crash that pops up for some users who encounter this path and allows us to gracefully just not play audio and log a message elsewhere.