| Lift freeq's AV media plane out of sleek 90f8b89 nandi 20d ago | 1 | ## How to install |
| 2 | |
| 3 | This example requires a nightly version of Rust to enable WebAssembly atomics and to recompile the standard library with atomics enabled. |
| 4 | |
| 5 | Note the flags set to configure that in .cargo/config.toml. |
| 6 | |
| 7 | This allows Rust to used shared memory and have the audio thread directly read / write to shared memory like a native platform. |
| 8 | |
| 9 | To use shared memory the browser requires a specific 'CORS' configuration on the server-side. |
| 10 | |
| 11 | Note the flags set to configure that in Trunk.toml. |
| 12 | |
| 13 | [trunk](https://trunkrs.dev/) is used to build and serve the example. |
| 14 | |
| 15 | ```sh |
| 16 | cargo install --locked trunk |
| 17 | # -- or -- |
| 18 | cargo binstall trunk |
| 19 | ``` |
| 20 | |
| 21 | ## How to run in debug mode |
| 22 | |
| 23 | ```sh |
| 24 | # Builds the project and opens it in a new browser tab. Auto-reloads when the project changes. |
| 25 | trunk serve --open |
| 26 | ``` |
| 27 | |
| 28 | ## How to build in release mode |
| 29 | |
| 30 | ```sh |
| 31 | # Builds the project in release mode and places it into the `dist` folder. |
| 32 | trunk build --release |
| 33 | ``` |
| 34 | |
| 35 | ## What does each file do? |
| 36 | |
| 37 | * `Cargo.toml` contains the standard Rust metadata. You put your Rust dependencies in here. You must change this file with your details (name, description, version, authors, categories) |
| 38 | |
| 39 | * The `src` folder contains your Rust code. |