Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd90cb628b | |||
| 37613a65c4 | |||
| d6b482528f | |||
| 5df7b0e082 |
@@ -18,7 +18,7 @@ jobs:
|
||||
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||
|
||||
- name: Install dioxus-cli
|
||||
run: cargo binstall dioxus-cli --version 0.7.2
|
||||
run: cargo binstall dioxus-cli --version 0.7.1
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
|
||||
@@ -22,6 +22,6 @@ jobs:
|
||||
- name: Build Windows image
|
||||
shell: bash
|
||||
run: |
|
||||
docker pull "$(grep -m1 '^FROM' Dockerfile | awk '{print $2}')"
|
||||
docker pull "$(grep -m1 '^FROM' ./docker/windows-release-builder.Dockerfile | awk '{print $2}')"
|
||||
docker build -t git.ohea.xyz/mumble/mumble-web2/windows-release-builder:latest -f ./docker/windows-release-builder.Dockerfile .
|
||||
docker push git.ohea.xyz/mumble/mumble-web2/windows-release-builder:latest
|
||||
|
||||
Generated
+73
-72
@@ -914,9 +914,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "const-serialize"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad7154afa56de2f290e3c82c2c6dc4f5b282b6870903f56ef3509aba95866edc"
|
||||
checksum = "fd339aa356cc6452308fad2ee56623f900a8e68bc0ab9360a0ddb8270e5640c8"
|
||||
dependencies = [
|
||||
"const-serialize-macro",
|
||||
"serde",
|
||||
@@ -924,9 +924,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "const-serialize-macro"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f160aad86b4343e8d4e261fee9965c3005b2fd6bc117d172ab65948779e4acf"
|
||||
checksum = "797d158acb331e2a89d696343a27cd39bf7e36aaef33ba4799a5ef1526e24861"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -1479,9 +1479,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3a115f9dbe5900c6044ee6a791e1b160c29989c6a8721eec099e01a964e5dae4"
|
||||
checksum = "f76e820919058a685a1fdbb2ef4888c73ac77d623c39a7dfde2aa812947246be"
|
||||
dependencies = [
|
||||
"dioxus-asset-resolver",
|
||||
"dioxus-cli-config",
|
||||
@@ -1507,9 +1507,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-asset-resolver"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6851ae49ba3988f1b77f6ef826eb142e811602129841c24bf5a4e103708d9844"
|
||||
checksum = "7f6a124667ce5565c39fe2f33af45c21fe459c5bfcf7a8074ad12c9e9da5817c"
|
||||
dependencies = [
|
||||
"dioxus-cli-config",
|
||||
"http",
|
||||
@@ -1528,18 +1528,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-cli-config"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c59e9d9da2e7334fdae5d77e3989207aa549062f74ff1ca2171393bbdd7fda90"
|
||||
checksum = "babc8eaf90379352bc4820830749fd231feb9312433d4094b4e7b79d912b3d96"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-config-macro"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9bd56be5ea6c9f416b25e9e3adc910c02127be75b6d1ecd567661f31920b27ba"
|
||||
checksum = "30018b5b95567cee42febbb444d5e5e47dbe3e91fa6e44b9e571edad0184cd36"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -1547,15 +1547,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-config-macros"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c49327465c2d434d00fb4c86bd35ae72155b479622e09352b950d9ab4807bf23"
|
||||
checksum = "0a16b25f8761253ed5ffa4d0789376310fbbc1bbaa8190fc2f374db82c6285a1"
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-core"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7400cbd21a98e585a13f8c29574da9b8afb2fd343f712618042b6c71761f0933"
|
||||
checksum = "75468d08468919f783b0f7ee826802f4e8e66c5b5a0451245d861c211ca18216"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"const_format",
|
||||
@@ -1571,13 +1571,14 @@ dependencies = [
|
||||
"slotmap",
|
||||
"subsecond",
|
||||
"tracing",
|
||||
"warnings",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-core-macro"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e51c0eb7eb76dd5a0b9a116d94d29ca78924a1ed1fcb7ea072eda5045d3ac056"
|
||||
checksum = "f145abdb2a3f858456cb4382390863cf0398c228ad0733618f48891da7687be3"
|
||||
dependencies = [
|
||||
"convert_case 0.8.0",
|
||||
"dioxus-rsx",
|
||||
@@ -1588,15 +1589,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-core-types"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0652ab5f9c2c32261d44a3155debbfd909ed03d03434d7f70f5a796bf255c519"
|
||||
checksum = "36f5ecf5a51de06d78aded3b5f7516a258f53117cba718bc5706317a3c04c844"
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-desktop"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b24aa7e4aa87fce202c5e67d560cddd9ed67ad533f16b7d922916c04993766ff"
|
||||
checksum = "f493c74ff09410c5eadf42abd031d4b3d4032a4d5a2411c77d1d0d5156ca3687"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64",
|
||||
@@ -1649,9 +1650,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-devtools"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9748128bcd102b10e58c765939807053ccab542206a939b8bab228077455c259"
|
||||
checksum = "4eb2c5019b7fa72e8e6b21ba99e9263bd390c9a30bbf09793b72f4b57ed7c3d7"
|
||||
dependencies = [
|
||||
"dioxus-cli-config",
|
||||
"dioxus-core",
|
||||
@@ -1663,13 +1664,14 @@ dependencies = [
|
||||
"thiserror 2.0.17",
|
||||
"tracing",
|
||||
"tungstenite 0.27.0",
|
||||
"warnings",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-devtools-types"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48540ca8a0ab1ec81cd4db35f0c9713d43b158647fc1dcb0d79965fc3b41d96c"
|
||||
checksum = "7b007cec5b8548281921c4e4678926a3936e9d6757e951380685cc6121a6f974"
|
||||
dependencies = [
|
||||
"dioxus-core",
|
||||
"serde",
|
||||
@@ -1678,9 +1680,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-document"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "501a189b391d091c9aa02c05f5b25f5d0d17fa0e1016e000b0fdbb073d77cd6a"
|
||||
checksum = "8c55bcae9aaf150d4a141c61b3826da5a7ac23dfff09726568525cd46336e9a2"
|
||||
dependencies = [
|
||||
"dioxus-core",
|
||||
"dioxus-core-macro",
|
||||
@@ -1697,9 +1699,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-fullstack"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "54150804265defdb21a6f2d8914a45316a1e7fb70ab22c30cf836e8fe2f8081b"
|
||||
checksum = "ff04cef82d6639eb15186f626298645dbd92978bf66dc3efd2e5984a2ff4a1ff"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-stream",
|
||||
@@ -1754,9 +1756,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-fullstack-core"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0a9be2ef4d701520eefef284d218fb35b159dccd6bccc02b5bad42945e2599d"
|
||||
checksum = "41281c7cd4d311a50933256e19a5d91d0d950ad350dd3232bd4321fdd3a59fb0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum-core",
|
||||
@@ -1782,9 +1784,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-fullstack-macro"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a31ea4451fe8c9d2af24fb718a94966d5fd7e11325777e5b5a59085c5c85e5fb"
|
||||
checksum = "ae73023c8b8fee2692fc50a28063336f0b6930e86727e30c1047c92d30805b49"
|
||||
dependencies = [
|
||||
"const_format",
|
||||
"convert_case 0.8.0",
|
||||
@@ -1796,9 +1798,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-history"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "55d704b3ba9504cb3c9cde49499b75546d1faaff2736f4c368aca6c061c48ac3"
|
||||
checksum = "dac73657da5c7a20629482d774b52f4a4f7cb57a520649f1d855d4073e809c98"
|
||||
dependencies = [
|
||||
"dioxus-core",
|
||||
"tracing",
|
||||
@@ -1806,9 +1808,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-hooks"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "79c6d68be372eca8186a1c57ec49be67a6ea46022150b5e85ab6a6acde52d272"
|
||||
checksum = "7ffd445f16d64939e06cd71a1c63a665f383fda6b7882f4c6f8f1bd6efca2046"
|
||||
dependencies = [
|
||||
"dioxus-core",
|
||||
"dioxus-signals",
|
||||
@@ -1818,13 +1820,14 @@ dependencies = [
|
||||
"rustversion",
|
||||
"slab",
|
||||
"tracing",
|
||||
"warnings",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-html"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3aa87ecfa0f38ec286be25789a7f2d6c30778111f1fbff563da4bae41d171496"
|
||||
checksum = "9f407fc73a9554a644872fcccc9faf762acad8f45158e3d67e42ab8dd42f4586"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
@@ -1849,9 +1852,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-html-internal-macro"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49301d0e389378e8070b8b704110339a0d3358efad9f5ad483ffab3a8d406dae"
|
||||
checksum = "a968aae4bc92de87cbac3d0d043803b25a7c62c187841e61adcc9b49917c2b2a"
|
||||
dependencies = [
|
||||
"convert_case 0.8.0",
|
||||
"proc-macro2",
|
||||
@@ -1861,9 +1864,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-interpreter-js"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f5437a89d3ef7edfebc0f10acb065f1709cb7ffb678e3a4bb1416706d71f7c67"
|
||||
checksum = "83ab170d89308399205f8ad3d43d8d419affe317016b41ca0695186f7593cba2"
|
||||
dependencies = [
|
||||
"dioxus-core",
|
||||
"dioxus-core-types",
|
||||
@@ -1881,9 +1884,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-logger"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2b25ebfbc193cebcf5af5e19b8ee7c6adee486fbd1c12f11aea058b464da16f9"
|
||||
checksum = "42237934c6a67f5ed9a8c37e47ca980ee7cfec9e783a9a1f8c2e36c8b96ae74b"
|
||||
dependencies = [
|
||||
"dioxus-cli-config",
|
||||
"tracing",
|
||||
@@ -1893,22 +1896,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-rsx"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19d97c02689beff55767ba5f6e185ffd204c6a193e372f0fead8a3722c6f7eea"
|
||||
checksum = "f026380dfda8b93ad995c0a90a62a17b8afeb246baff1b781a52c7b1b3ebd791"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"proc-macro2-diagnostics",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn 2.0.108",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-signals"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27fc4df7a31a7f02e5a0b40884bb66ee165226a05d75fce03baa44029e438762"
|
||||
checksum = "3895cc17ff5b43ada07743111be586e7a927ed7ec511457020e4235e13e63fe6"
|
||||
dependencies = [
|
||||
"dioxus-core",
|
||||
"futures-channel",
|
||||
@@ -1922,21 +1924,20 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-stores"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2dec3cd677078824a733de25ddbe8e987cfc8d98aec29b7d199e1fdb8452b96"
|
||||
checksum = "8521729ac35f362476ac4eb7d1c4ab79e7e92a0facfdea3ee978c0ddf7108d37"
|
||||
dependencies = [
|
||||
"dioxus-core",
|
||||
"dioxus-signals",
|
||||
"dioxus-stores-macro",
|
||||
"generational-box",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-stores-macro"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9b7f085e374aaaa78403227b9bd83675c4078388d41a41b67dfbe4aa0bb64d5"
|
||||
checksum = "23a733d2684dc843e81954f6176b3353e4cfc71b6978a8e464591bb5536f610b"
|
||||
dependencies = [
|
||||
"convert_case 0.8.0",
|
||||
"proc-macro2",
|
||||
@@ -1946,9 +1947,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dioxus-web"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "315009f3a77c3c813415b3b8a8ea62a4d7a32dde9a666664b30862d4386e8456"
|
||||
checksum = "76155ecd44535e7c096ec8c5aac4a945899e47567ead4869babdaa74f3f9bca0"
|
||||
dependencies = [
|
||||
"dioxus-cli-config",
|
||||
"dioxus-core",
|
||||
@@ -2663,9 +2664,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "generational-box"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e658d10252a15200ca4a1c67c7180fc0baffa3f92869bbd903025daf6f70fd65"
|
||||
checksum = "b3c1ae09dfd2d455484a54b56129b9821241c4b0e412227806b6c3730cd18a29"
|
||||
dependencies = [
|
||||
"parking_lot",
|
||||
"tracing",
|
||||
@@ -3668,9 +3669,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lazy-js-bundle"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "21972afec4627b7ba0de60b5269585b5ac2f56d559b0696f57eee6daf8a51b68"
|
||||
checksum = "409273b42d0e3ae7c8ce6b8cfbc6a27b7c7d83bbb94fc7f93f22cc9b90eea078"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
@@ -3973,9 +3974,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "manganis"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97c63ae68d25457a579b7714806088c5cb44c536cf624a53a17184878f9f0bcd"
|
||||
checksum = "124f8f094eb75783b38209ce4d534b9617da4efac652802d9bafe05043a3ec95"
|
||||
dependencies = [
|
||||
"const-serialize",
|
||||
"manganis-core",
|
||||
@@ -3984,9 +3985,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "manganis-core"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88d071660b149f985cbab8b23f2004ea6dd5cf947b63a0843f0e2f46e6af7229"
|
||||
checksum = "41fbd1fb8c5aabcc54c6b02dbc968e1c89c28f3e543f2789ef9e3ce45dbdf5df"
|
||||
dependencies = [
|
||||
"const-serialize",
|
||||
"dioxus-cli-config",
|
||||
@@ -3996,9 +3997,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "manganis-macro"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9793d1d33778245b4240c330a8f575d208ce077c7e7bab1c79064252ddd4a162"
|
||||
checksum = "45d6fec2a8249739bb30b53a08ecbb217f76096c08f1053f38ec3981ba424c11"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"macro-string",
|
||||
@@ -6995,9 +6996,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "subsecond"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c09bc2c9ef0381b403ab8b58122961cb83266d16b1f55f9486d5857ba4a9ae26"
|
||||
checksum = "834e8caec50249083ee6972a2f7645c4baadcb39d49ea801da1dc1d5e1c2ccb9"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"libc",
|
||||
@@ -7014,9 +7015,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "subsecond-types"
|
||||
version = "0.7.2"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d07aa455c66ddfdbb51507537402b961e027846468954ef8d974bce65dff9eb0"
|
||||
checksum = "c6beffea67e72a7a530990b270fd0277971eae564fdc10c1e0080e928b477fab"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
## Running Desktop
|
||||
|
||||
1. `cargo install dioxus-cli --version 0.7.2`
|
||||
1. `cargo install dioxus-cli --version 0.7.1`
|
||||
2. `dx run -p mumble-web2-gui --platform desktop --release`
|
||||
|
||||
## Running Web (development)
|
||||
|
||||
1. `cargo install dioxus-cli --version 0.7.2`
|
||||
1. `cargo install dioxus-cli --version 0.7.1`
|
||||
3. `dx serve -p mumble-web2-gui --platform web`
|
||||
2. `cd docker && docker compose up`
|
||||
4. connect to `https://localhost:64444`
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
## Running Web (with `proxy` only)
|
||||
|
||||
1. `cargo install dioxus-cli --version 0.7.2`
|
||||
1. `cargo install dioxus-cli --version 0.7.1`
|
||||
2. `dx build -p mumble-web2-gui --platform web --release`
|
||||
3. `cp config.toml.example config.toml`
|
||||
4. `cargo run -p mumble-web2-proxy` in the background
|
||||
|
||||
@@ -3,7 +3,6 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Default)]
|
||||
pub struct ClientConfig {
|
||||
pub proxy_url: Option<String>,
|
||||
pub status_url: Option<String>,
|
||||
pub cert_hash: Option<Vec<u8>>,
|
||||
pub any_server: bool,
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
public_url = "https://127.0.0.1:4433"
|
||||
proxy_url = "https://127.0.0.1:4433/proxy"
|
||||
https_listen_address = "127.0.0.1:4433"
|
||||
http_listen_address = "127.0.0.1:8080"
|
||||
mumble_server_url = "[SERVER_URL_HERE]"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
public_url = "https://localhost:64444"
|
||||
proxy_url = "https://127.0.0.1:4433/proxy"
|
||||
https_listen_address = "127.0.0.1:4433"
|
||||
http_listen_address = "127.0.0.1:4400"
|
||||
|
||||
@@ -44,11 +44,10 @@ RUN choco install rustup.install -y --no-progress
|
||||
RUN rustup toolchain install stable-x86_64-pc-windows-msvc
|
||||
RUN rustup default stable-x86_64-pc-windows-msvc
|
||||
|
||||
RUN Set-ExecutionPolicy Unrestricted -Scope Process; `
|
||||
iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content
|
||||
|
||||
SHELL ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
|
||||
|
||||
RUN cargo binstall dioxus-cli --version 0.7.2
|
||||
# Install dioxus-cli from git HEAD with cargo
|
||||
# This is to work around a bug in the windows builder upstream.
|
||||
# Dioxus has released 0.7.2, but it seems to be broken for now.
|
||||
RUN cargo install --git https://github.com/DioxusLabs/dioxus dioxus-cli
|
||||
|
||||
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
|
||||
|
||||
+9
-7
@@ -6,7 +6,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
# Web Dependencies
|
||||
# ================
|
||||
dioxus-web = { version = "0.7.2", optional = true }
|
||||
dioxus-web = { version = "0.7.1", optional = true }
|
||||
wasm-bindgen = { version = "^0.2.92", optional = true }
|
||||
wasm-bindgen-futures = { version = "^0.4.42", optional = true }
|
||||
wasm-streams = { version = "^0.4.0", optional = true }
|
||||
@@ -30,8 +30,6 @@ web-sys = { version = "^0.3.72", features = [
|
||||
"EncodedAudioChunkInit",
|
||||
"EncodedAudioChunkType",
|
||||
"CodecState",
|
||||
"MediaStreamTrackGenerator",
|
||||
"MediaStreamTrackGeneratorInit",
|
||||
"AudioContext",
|
||||
"AudioContextOptions",
|
||||
"MediaStream",
|
||||
@@ -42,6 +40,7 @@ web-sys = { version = "^0.3.72", features = [
|
||||
"AudioWorkletNode",
|
||||
"AudioWorklet",
|
||||
"AudioWorkletProcessor",
|
||||
"MessagePort",
|
||||
"MediaStreamConstraints",
|
||||
"WorkletOptions",
|
||||
"AudioEncoder",
|
||||
@@ -67,7 +66,7 @@ dasp_ring_buffer = { version = "0.11.0", optional = true }
|
||||
|
||||
# Base Dependencies
|
||||
# ================
|
||||
dioxus = { version = "0.7.2" }
|
||||
dioxus = { version = "0.7.1" }
|
||||
once_cell = "1.19.0"
|
||||
asynchronous-codec = { workspace = true }
|
||||
futures = "^0.3.30"
|
||||
@@ -88,16 +87,18 @@ tracing = "^0.1.40"
|
||||
color-eyre = "^0.6.3"
|
||||
crossbeam-queue = "^0.3.11"
|
||||
lol_html = "^2.2.0"
|
||||
rfd = { git = "https://github.com/samsartor/rfd.git", version = "^0.16.0", default-features = false }
|
||||
rfd = { git = "https://github.com/samsartor/rfd.git", version = "^0.16.0", default-features = false }
|
||||
base64 = "^0.22"
|
||||
mime_guess = "^2.0.5"
|
||||
async_cell = "^0.2.3"
|
||||
reqwest = { version = "^0.12.22", features = ["json"] }
|
||||
dioxus-asset-resolver = "0.7.2"
|
||||
dioxus-asset-resolver = "0.7.1"
|
||||
|
||||
# Denoising
|
||||
# =========
|
||||
deep_filter = { git = "https://github.com/Rikorose/DeepFilterNet.git", rev = "d375b2d8309e0935d165700c91da9de862a99c31", features = ["tract"] }
|
||||
deep_filter = { git = "https://github.com/Rikorose/DeepFilterNet.git", rev = "d375b2d8309e0935d165700c91da9de862a99c31", features = [
|
||||
"tract",
|
||||
] }
|
||||
crossbeam = "0.8.4"
|
||||
|
||||
[patch.crates-io]
|
||||
@@ -131,3 +132,4 @@ desktop = [
|
||||
"rfd/xdg-portal",
|
||||
"rfd/tokio",
|
||||
]
|
||||
|
||||
|
||||
@@ -279,6 +279,11 @@ a:visited {
|
||||
color: #b3c6b4;
|
||||
}
|
||||
|
||||
&_version {
|
||||
color: var(--txt-color);
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
&_bttn {
|
||||
font-weight: bold;
|
||||
font-size: large;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const SAMPLE_RATE = 48000;
|
||||
const PACKET_SAMPLES = 960;
|
||||
|
||||
class RustWorklet extends AudioWorkletProcessor {
|
||||
class RustMicWorklet extends AudioWorkletProcessor {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.module = options.processorOptions;
|
||||
@@ -31,7 +31,7 @@ class RustWorklet extends AudioWorkletProcessor {
|
||||
}
|
||||
this.buffer_offset -= PACKET_SAMPLES;
|
||||
this.timestamp = null;
|
||||
}
|
||||
}
|
||||
|
||||
process(inputs) {
|
||||
//console.log(inputs);
|
||||
@@ -60,4 +60,44 @@ class RustWorklet extends AudioWorkletProcessor {
|
||||
}
|
||||
};
|
||||
|
||||
registerProcessor("rust_mic_worklet", RustWorklet);
|
||||
|
||||
class RustSpeakerWorklet extends AudioWorkletProcessor {
|
||||
constructor() {
|
||||
super();
|
||||
this.queue = [];
|
||||
this.readIndex = 0;
|
||||
|
||||
this.port.onmessage = (event) => {
|
||||
this.queue.push(event.data)
|
||||
};
|
||||
}
|
||||
|
||||
process(inputs, outputs) {
|
||||
if (this.queue.length) {
|
||||
console.log(this.queue[0].samples.length, outputs[0][0].length);
|
||||
}
|
||||
|
||||
const output = outputs[0];
|
||||
|
||||
for (let i = 0; i < output[0].length; i++) {
|
||||
if (!this.queue.length) {
|
||||
return true;
|
||||
}
|
||||
const current = this.queue[0];
|
||||
for (let ch = 0; ch < output.length; ch++) {
|
||||
output[ch][i] = current.samples[this.readIndex];
|
||||
}
|
||||
this.readIndex++;
|
||||
if (this.readIndex >= current.samples.length) {
|
||||
this.queue.shift();
|
||||
this.readIndex = 0;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
registerProcessor("rust_mic_worklet", RustMicWorklet);
|
||||
registerProcessor("rust_speaker_worklet", RustSpeakerWorklet);
|
||||
+56
-8
@@ -1,7 +1,39 @@
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
fn version_env() -> Option<()> {
|
||||
if env::var("MUMBLE_WEB2_VERSION").is_ok() {
|
||||
return Some(());
|
||||
}
|
||||
|
||||
let output = Command::new("git")
|
||||
.args(["rev-parse", "--short", "HEAD"])
|
||||
.output()
|
||||
.ok()?;
|
||||
|
||||
let git_hash = String::from_utf8(output.stdout).ok()?;
|
||||
let git_hash = git_hash.trim(); // drop trailing newline
|
||||
|
||||
let status = Command::new("git")
|
||||
.args(["status", "--porcelain"])
|
||||
.output()
|
||||
.ok()?;
|
||||
let dirty = match status.stdout.is_empty() {
|
||||
true => "",
|
||||
false => "-dirty",
|
||||
};
|
||||
|
||||
// Expose it as a compile-time env var
|
||||
println!("cargo::rustc-env=MUMBLE_WEB2_VERSION=git-{git_hash}{dirty}");
|
||||
|
||||
// Optional: rebuild when HEAD changes
|
||||
println!("cargo::rerun-if-changed=.git/HEAD");
|
||||
|
||||
Some(())
|
||||
}
|
||||
|
||||
fn download_deepfilternet() {
|
||||
// Define the target directory and file
|
||||
let assets_dir = "assets";
|
||||
let target_file = format!("{}/DeepFilterNet3_ll_onnx.tar.gz", assets_dir);
|
||||
@@ -9,30 +41,46 @@ fn main() {
|
||||
|
||||
// Check if the file already exists
|
||||
if target_path.exists() {
|
||||
println!("cargo:warning=DeepFilterNet model already exists at {}", target_file);
|
||||
println!(
|
||||
"cargo::warning=DeepFilterNet model already exists at {}",
|
||||
target_file
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
println!("cargo:warning=Downloading DeepFilterNet model to {}...", target_file);
|
||||
println!(
|
||||
"cargo::warning=Downloading DeepFilterNet model to {}...",
|
||||
target_file
|
||||
);
|
||||
|
||||
// Download the file using curl
|
||||
let url = "https://github.com/Rikorose/DeepFilterNet/raw/refs/heads/main/models/DeepFilterNet3_ll_onnx.tar.gz";
|
||||
|
||||
let status = Command::new("curl")
|
||||
.args([
|
||||
"-L", // Follow redirects
|
||||
"-o", &target_file, // Output file
|
||||
"-L", // Follow redirects
|
||||
"-o",
|
||||
&target_file, // Output file
|
||||
url,
|
||||
])
|
||||
.status()
|
||||
.expect("Failed to execute curl command. Make sure curl is installed.");
|
||||
|
||||
if !status.success() {
|
||||
panic!("Failed to download DeepFilterNet model from {}", url);
|
||||
println!("cargo::error=Failed to download DeepFilterNet model from {url}");
|
||||
return;
|
||||
}
|
||||
|
||||
println!("cargo:warning=Successfully downloaded DeepFilterNet model to {}", target_file);
|
||||
println!(
|
||||
"cargo::warning=Successfully downloaded DeepFilterNet model to {}",
|
||||
target_file
|
||||
);
|
||||
|
||||
// Rerun this build script if the target file is deleted
|
||||
println!("cargo:rerun-if-changed={}", target_file);
|
||||
println!("cargo::rerun-if-changed={}", target_file);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
version_env();
|
||||
download_deepfilternet();
|
||||
}
|
||||
|
||||
+6
-19
@@ -545,33 +545,15 @@ pub fn ServerView(config: Resource<ClientConfig>) -> Element {
|
||||
)
|
||||
}
|
||||
|
||||
async fn get_status(
|
||||
client: &reqwest::Client,
|
||||
status_url: &str,
|
||||
) -> color_eyre::Result<ServerStatus> {
|
||||
Ok(client
|
||||
.get(status_url)
|
||||
.send()
|
||||
.await?
|
||||
.json::<ServerStatus>()
|
||||
.await?)
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn LoginView(config: Resource<ClientConfig>) -> Element {
|
||||
let net: Coroutine<Command> = use_coroutine_handle();
|
||||
|
||||
let last_status = use_signal(|| None::<color_eyre::Result<ServerStatus>>);
|
||||
use_resource(move || async move {
|
||||
let Some(config) = config.read().clone() else {
|
||||
return;
|
||||
};
|
||||
let Some(status_url) = config.status_url else {
|
||||
return;
|
||||
};
|
||||
let client = reqwest::Client::new();
|
||||
loop {
|
||||
*last_status.write_unchecked() = Some(get_status(&client, &status_url).await);
|
||||
*last_status.write_unchecked() = Some(imp::get_status(&client).await);
|
||||
imp::sleep(std::time::Duration::from_secs_f32(1.0)).await;
|
||||
}
|
||||
});
|
||||
@@ -630,11 +612,16 @@ pub fn LoginView(config: Resource<ClientConfig>) -> Element {
|
||||
),
|
||||
Connected => unreachable!(),
|
||||
};
|
||||
let version = option_env!("MUMBLE_WEB2_VERSION");
|
||||
rsx!(
|
||||
div {
|
||||
class: "login",
|
||||
h1 {
|
||||
"Mumble Web"
|
||||
match version {
|
||||
Some(v) => rsx!(" " span { class: "login_version", "({v})" }),
|
||||
None => rsx!(),
|
||||
}
|
||||
}
|
||||
if config.read().as_ref().is_some_and(|cfg| cfg.any_server) {
|
||||
div {
|
||||
|
||||
+3
-3
@@ -97,13 +97,13 @@ impl AudioProcessor {
|
||||
}
|
||||
|
||||
impl AudioProcessor {
|
||||
pub fn process(&mut self, audio: &[f32], output: &mut Vec<f32>) {
|
||||
pub fn process(&mut self, audio: &[f32], channels: usize, output: &mut Vec<f32>) {
|
||||
let mut include_raw = true;
|
||||
if self.denoise {
|
||||
with_denoising_model(&self.spawn, |df| {
|
||||
include_raw = false;
|
||||
|
||||
self.buffer.extend_from_slice(audio);
|
||||
self.buffer.extend(audio.iter().step_by(channels).copied());
|
||||
output.reserve(audio.len());
|
||||
|
||||
let hop = df.hop_size;
|
||||
@@ -130,7 +130,7 @@ impl AudioProcessor {
|
||||
}
|
||||
|
||||
if include_raw {
|
||||
output.extend_from_slice(audio);
|
||||
output.extend(audio.iter().step_by(channels).copied());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+62
-25
@@ -1,11 +1,11 @@
|
||||
use crate::app::Command;
|
||||
use crate::effects::{AudioProcessor, AudioProcessorSender};
|
||||
use color_eyre::eyre::{eyre, Context, Error};
|
||||
use cpal::traits::{DeviceTrait, HostTrait};
|
||||
use color_eyre::eyre::{bail, eyre, Context, Error};
|
||||
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait as _};
|
||||
use dioxus::hooks::UnboundedReceiver;
|
||||
use futures::io::{AsyncRead, AsyncWrite};
|
||||
use mumble_protocol::control::ClientControlCodec;
|
||||
use mumble_web2_common::ClientConfig;
|
||||
use mumble_web2_common::{ClientConfig, ServerStatus};
|
||||
use std::mem::replace;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::sync::Arc;
|
||||
@@ -43,7 +43,7 @@ const PACKET_SAMPLES: u32 = 960;
|
||||
type Buffer = Arc<Mutex<dasp_ring_buffer::Bounded<Vec<i16>>>>;
|
||||
|
||||
impl AudioSystem {
|
||||
pub fn new() -> Result<Self, Error> {
|
||||
pub async fn new() -> Result<Self, Error> {
|
||||
// TODO
|
||||
let host = cpal::default_host();
|
||||
let name = host.id();
|
||||
@@ -64,10 +64,46 @@ impl AudioSystem {
|
||||
self.processors.store(Some(processor))
|
||||
}
|
||||
|
||||
fn choose_config(
|
||||
&self,
|
||||
configs: impl Iterator<Item = cpal::SupportedStreamConfigRange>,
|
||||
) -> Result<cpal::StreamConfig, Error> {
|
||||
let mut supported_configs: Vec<_> = configs
|
||||
.filter_map(|cfg| cfg.try_with_sample_rate(cpal::SampleRate(SAMPLE_RATE)))
|
||||
.filter(|cfg| cfg.sample_format() == cpal::SampleFormat::I16)
|
||||
.map(|cfg| cpal::StreamConfig {
|
||||
buffer_size: cpal::BufferSize::Fixed(match *cfg.buffer_size() {
|
||||
cpal::SupportedBufferSize::Range { min, max } => 480.clamp(min, max),
|
||||
cpal::SupportedBufferSize::Unknown => 480,
|
||||
}),
|
||||
..cfg.config()
|
||||
})
|
||||
.collect();
|
||||
supported_configs.sort_by(|a, b| {
|
||||
let cpal::BufferSize::Fixed(a_buf) = a.buffer_size else {
|
||||
unreachable!()
|
||||
};
|
||||
let cpal::BufferSize::Fixed(b_buf) = b.buffer_size else {
|
||||
unreachable!()
|
||||
};
|
||||
Ord::cmp(&a.channels, &b.channels).then(Ord::cmp(&a_buf, &b_buf))
|
||||
});
|
||||
supported_configs
|
||||
.get(0)
|
||||
.cloned()
|
||||
.ok_or(eyre!("no supported stream configs"))
|
||||
}
|
||||
|
||||
pub fn start_recording(
|
||||
&mut self,
|
||||
mut each: impl FnMut(Vec<u8>) + Send + 'static,
|
||||
) -> Result<(), Error> {
|
||||
let config = self.choose_config(self.input.supported_input_configs()?)?;
|
||||
info!(
|
||||
"creating recording on {:?} with {:#?}",
|
||||
self.input.name()?,
|
||||
config
|
||||
);
|
||||
let mut encoder =
|
||||
opus::Encoder::new(SAMPLE_RATE, opus::Channels::Mono, opus::Application::Voip)?;
|
||||
let mut current_processor = AudioProcessor::new_plain();
|
||||
@@ -78,7 +114,7 @@ impl AudioSystem {
|
||||
if let Some(new_processor) = processors.take() {
|
||||
current_processor = new_processor;
|
||||
}
|
||||
current_processor.process(frame, &mut output_buffer);
|
||||
current_processor.process(frame, config.channels as usize, &mut output_buffer);
|
||||
if output_buffer.len() < PACKET_SAMPLES as usize {
|
||||
return;
|
||||
}
|
||||
@@ -94,17 +130,12 @@ impl AudioSystem {
|
||||
}
|
||||
};
|
||||
|
||||
match self.input.build_input_stream(
|
||||
&cpal::StreamConfig {
|
||||
channels: 1,
|
||||
sample_rate: cpal::SampleRate(SAMPLE_RATE),
|
||||
buffer_size: cpal::BufferSize::Fixed(PACKET_SAMPLES),
|
||||
},
|
||||
data_callback,
|
||||
error_callback,
|
||||
None,
|
||||
) {
|
||||
match self
|
||||
.input
|
||||
.build_input_stream(&config, data_callback, error_callback, None)
|
||||
{
|
||||
Ok(stream) => {
|
||||
stream.play()?;
|
||||
self.recording_stream = Some(stream);
|
||||
Ok(())
|
||||
}
|
||||
@@ -116,6 +147,12 @@ impl AudioSystem {
|
||||
}
|
||||
|
||||
pub fn create_player(&mut self) -> Result<AudioPlayer, Error> {
|
||||
let config = self.choose_config(self.input.supported_input_configs()?)?;
|
||||
info!(
|
||||
"creating player on {:?} with {:#?}",
|
||||
self.output.name().ok(),
|
||||
&config
|
||||
);
|
||||
let buffer = Arc::new(Mutex::new(dasp_ring_buffer::Bounded::from_raw_parts(
|
||||
0,
|
||||
0,
|
||||
@@ -128,20 +165,16 @@ impl AudioSystem {
|
||||
let stream = {
|
||||
let buffer = buffer.clone();
|
||||
self.output.build_output_stream(
|
||||
&cpal::StreamConfig {
|
||||
channels: 1,
|
||||
sample_rate: cpal::SampleRate(SAMPLE_RATE),
|
||||
buffer_size: cpal::BufferSize::Fixed(480), // 10ms playback delay
|
||||
},
|
||||
move |frame, info| {
|
||||
&config,
|
||||
move |frame, _info| {
|
||||
let mut buffer = buffer.lock().unwrap();
|
||||
for x in frame.iter_mut() {
|
||||
for x in frame.chunks_mut(config.channels as usize) {
|
||||
match buffer.pop() {
|
||||
Some(y) => {
|
||||
*x = y;
|
||||
x.fill(y);
|
||||
}
|
||||
None => {
|
||||
*x = 0;
|
||||
x.fill(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,6 +183,7 @@ impl AudioSystem {
|
||||
None,
|
||||
)?
|
||||
};
|
||||
stream.play()?;
|
||||
Ok(AudioPlayer {
|
||||
decoder,
|
||||
stream,
|
||||
@@ -291,12 +325,15 @@ pub fn load_username() -> Option<String> {
|
||||
pub async fn load_config() -> color_eyre::Result<ClientConfig> {
|
||||
Ok(ClientConfig {
|
||||
proxy_url: None,
|
||||
status_url: None,
|
||||
cert_hash: None,
|
||||
any_server: true,
|
||||
})
|
||||
}
|
||||
|
||||
pub async fn get_status(client: &reqwest::Client) -> color_eyre::Result<ServerStatus> {
|
||||
bail!("status not supported on desktop yet")
|
||||
}
|
||||
|
||||
pub fn init_logging() {
|
||||
use tracing::level_filters::LevelFilter;
|
||||
use tracing_subscriber::filter::EnvFilter;
|
||||
|
||||
+68
-56
@@ -6,7 +6,7 @@ use futures::{AsyncRead, AsyncWrite};
|
||||
use gloo_timers::future::TimeoutFuture;
|
||||
use js_sys::Float32Array;
|
||||
use mumble_protocol::control::ClientControlCodec;
|
||||
use mumble_web2_common::ClientConfig;
|
||||
use mumble_web2_common::{ClientConfig, ServerStatus};
|
||||
use reqwest::Url;
|
||||
use std::future::Future;
|
||||
use std::time::Duration;
|
||||
@@ -15,7 +15,6 @@ use tracing::{debug, error, info, instrument};
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_futures::JsFuture;
|
||||
use web_sys::js_sys::{Promise, Reflect, Uint8Array};
|
||||
use web_sys::AudioContext;
|
||||
use web_sys::AudioContextOptions;
|
||||
use web_sys::AudioData;
|
||||
use web_sys::AudioDecoder;
|
||||
@@ -30,14 +29,13 @@ use web_sys::EncodedAudioChunkInit;
|
||||
use web_sys::EncodedAudioChunkType;
|
||||
use web_sys::MediaStream;
|
||||
use web_sys::MediaStreamConstraints;
|
||||
use web_sys::MediaStreamTrackGenerator;
|
||||
use web_sys::MediaStreamTrackGeneratorInit;
|
||||
use web_sys::MessageEvent;
|
||||
use web_sys::WebTransport;
|
||||
use web_sys::WebTransportBidirectionalStream;
|
||||
use web_sys::WebTransportOptions;
|
||||
use web_sys::WorkletOptions;
|
||||
use web_sys::{console, window};
|
||||
use web_sys::{AudioContext, AudioDataCopyToOptions};
|
||||
|
||||
pub use wasm_bindgen_futures::spawn_local as spawn;
|
||||
|
||||
@@ -78,12 +76,41 @@ pub struct AudioSystem {
|
||||
processors: AudioProcessorSender,
|
||||
}
|
||||
|
||||
async fn attach_worklet(audio_context: &AudioContext) -> Result<(), Error> {
|
||||
// Create worklets to process mic and speaker audio
|
||||
// Speaker audio processing worklet only required on
|
||||
// browsers that don't support MediaStreamTrackGenerator
|
||||
|
||||
let options = WorkletOptions::new();
|
||||
Reflect::set(
|
||||
&options,
|
||||
&"processorOptions".into(),
|
||||
&wasm_bindgen::module(),
|
||||
)
|
||||
.ey()?;
|
||||
|
||||
let module = asset!("assets/rust_audio_worklet.js").to_string();
|
||||
info!("loading mic worklet from {module:?}");
|
||||
audio_context
|
||||
.audio_worklet()
|
||||
.ey()?
|
||||
.add_module_with_options(&module, &options)
|
||||
.ey()?
|
||||
.into_future()
|
||||
.await
|
||||
.ey()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl AudioSystem {
|
||||
pub fn new() -> Result<Self, Error> {
|
||||
pub async fn new() -> Result<Self, Error> {
|
||||
// Create MediaStreams to playback decoded audio
|
||||
// The audio context is used to reproduce audio.
|
||||
let webctx = configure_audio_context();
|
||||
attach_worklet(&webctx).await?;
|
||||
|
||||
let processors = AudioProcessorSender::default();
|
||||
|
||||
Ok(AudioSystem { webctx, processors })
|
||||
}
|
||||
|
||||
@@ -104,18 +131,10 @@ impl AudioSystem {
|
||||
}
|
||||
|
||||
pub fn create_player(&mut self) -> Result<AudioPlayer, Error> {
|
||||
let audio_stream_generator =
|
||||
MediaStreamTrackGenerator::new(&MediaStreamTrackGeneratorInit::new("audio")).ey()?;
|
||||
let sink_node = AudioWorkletNode::new(&self.webctx, "rust_speaker_worklet").ey()?;
|
||||
|
||||
// Create MediaStream from MediaStreamTrackGenerator
|
||||
let js_tracks = web_sys::js_sys::Array::new();
|
||||
js_tracks.push(&audio_stream_generator);
|
||||
let media_stream = MediaStream::new_with_tracks(&js_tracks).ey()?;
|
||||
|
||||
// Create MediaStreamAudioSourceNode
|
||||
let audio_source = self.webctx.create_media_stream_source(&media_stream).ey()?;
|
||||
// Connect output of audio_source to audio_context (browser audio)
|
||||
audio_source
|
||||
// Connect worklet to destination
|
||||
sink_node
|
||||
.connect_with_audio_node(&self.webctx.destination())
|
||||
.ey()?;
|
||||
|
||||
@@ -124,28 +143,31 @@ impl AudioSystem {
|
||||
error!("error decoding audio {:?}", e);
|
||||
}) as Box<dyn FnMut(JsValue)>);
|
||||
|
||||
// This knows what MediaStreamTrackGenerator to use as it closes around it
|
||||
let sink_port = sink_node.port().ey()?;
|
||||
|
||||
let output = Closure::wrap(Box::new(move |audio_data: AudioData| {
|
||||
let writable = audio_stream_generator.writable();
|
||||
if writable.locked() {
|
||||
return;
|
||||
}
|
||||
if let Err(e) = writable.get_writer().map(|writer| {
|
||||
spawn(async move {
|
||||
if let Err(e) = JsFuture::from(writer.ready()).await.ey() {
|
||||
error!("write chunk ready error {:?}", e);
|
||||
}
|
||||
if let Err(e) = JsFuture::from(writer.write_with_chunk(&audio_data))
|
||||
.await
|
||||
.ey()
|
||||
{
|
||||
error!("write chunk error {:?}", e);
|
||||
};
|
||||
writer.release_lock();
|
||||
});
|
||||
}) {
|
||||
error!("error writing audio data {:?}", e);
|
||||
// Extract planar PCM from AudioData into an ArrayBuffer or Float32Array
|
||||
// Here we assume f32 samples, 1 channel for brevity.
|
||||
let number_of_frames = audio_data.number_of_frames();
|
||||
|
||||
let js_buffer = Float32Array::new_with_length(number_of_frames);
|
||||
|
||||
let audio_data_copy_to_options = &AudioDataCopyToOptions::new(0);
|
||||
audio_data_copy_to_options.set_format(web_sys::AudioSampleFormat::F32);
|
||||
|
||||
if let Err(e) = audio_data
|
||||
.copy_to_with_buffer_source(&js_buffer.buffer(), &audio_data_copy_to_options)
|
||||
{
|
||||
error!("could not copy audio data to array {:?}", e);
|
||||
}
|
||||
|
||||
// Post to the worklet; include sampleRate and channel count if needed.
|
||||
let msg = js_sys::Object::new();
|
||||
js_sys::Reflect::set(&msg, &"samples".into(), &js_buffer).unwrap();
|
||||
|
||||
sink_port.post_message(&msg).unwrap();
|
||||
|
||||
audio_data.close();
|
||||
}) as Box<dyn FnMut(AudioData)>);
|
||||
|
||||
let audio_decoder = AudioDecoder::new(&AudioDecoderInit::new(
|
||||
@@ -209,7 +231,7 @@ fn process_audio(frame: &JsValue, processor: &mut AudioProcessor) {
|
||||
};
|
||||
let input = samples.to_vec();
|
||||
let mut output = Vec::with_capacity(input.len());
|
||||
processor.process(&input, &mut output);
|
||||
processor.process(&input, 1, &mut output);
|
||||
samples.copy_from(&output);
|
||||
}
|
||||
|
||||
@@ -234,25 +256,6 @@ async fn run_encoder_worklet(
|
||||
.map_err(|e| JsError::new(&format!("not a stream: {e:?}")))
|
||||
.ey()?;
|
||||
|
||||
let options = WorkletOptions::new();
|
||||
Reflect::set(
|
||||
&options,
|
||||
&"processorOptions".into(),
|
||||
&wasm_bindgen::module(),
|
||||
)
|
||||
.ey()?;
|
||||
|
||||
let module = asset!("assets/rust_mic_worklet.js").to_string();
|
||||
info!("loading mic worklet from {module:?}");
|
||||
audio_context
|
||||
.audio_worklet()
|
||||
.ey()?
|
||||
.add_module_with_options(&module, &options)
|
||||
.ey()?
|
||||
.into_future()
|
||||
.await
|
||||
.ey()?;
|
||||
|
||||
let source = audio_context.create_media_stream_source(&stream).ey()?;
|
||||
let worklet_node = AudioWorkletNode::new(audio_context, "rust_mic_worklet").ey()?;
|
||||
|
||||
@@ -426,6 +429,15 @@ pub async fn load_config() -> color_eyre::Result<ClientConfig> {
|
||||
Ok(config)
|
||||
}
|
||||
|
||||
pub async fn get_status(client: &reqwest::Client) -> color_eyre::Result<ServerStatus> {
|
||||
Ok(client
|
||||
.get(absolute_url("status")?)
|
||||
.send()
|
||||
.await?
|
||||
.json::<ServerStatus>()
|
||||
.await?)
|
||||
}
|
||||
|
||||
pub fn init_logging() {
|
||||
// copied from tracing_web example usage
|
||||
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ pub async fn network_loop<R: imp::ImpRead, W: imp::ImpWrite>(
|
||||
});
|
||||
}
|
||||
|
||||
let mut audio = imp::AudioSystem::new()?;
|
||||
let mut audio = imp::AudioSystem::new().await?;
|
||||
{
|
||||
let send_chan = send_chan.clone();
|
||||
let mut sequence_num = 0;
|
||||
|
||||
+1
-7
@@ -1,10 +1,6 @@
|
||||
use color_eyre::eyre::{anyhow, bail, Context, Result};
|
||||
use color_eyre::owo_colors::OwoColorize;
|
||||
use mumble_web2_common::{ClientConfig, ServerStatus};
|
||||
use once_cell::sync::OnceCell;
|
||||
use rand::Rng;
|
||||
use rcgen::date_time_ymd;
|
||||
use rustls::server;
|
||||
use salvo::conn::rustls::{Keycert, RustlsConfig};
|
||||
use salvo::cors::{AllowOrigin, Cors};
|
||||
use salvo::logging::Logger;
|
||||
@@ -38,7 +34,6 @@ fn default_cert_alt_names() -> Vec<String> {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
struct Config {
|
||||
public_url: Url,
|
||||
proxy_url: Option<Url>,
|
||||
https_listen_address: SocketAddr,
|
||||
http_listen_address: Option<SocketAddr>,
|
||||
@@ -85,9 +80,8 @@ async fn main() -> Result<()> {
|
||||
let mut client_config = ClientConfig {
|
||||
proxy_url: match &server_config.proxy_url {
|
||||
Some(url) => Some(url.to_string()),
|
||||
None => Some(server_config.public_url.join("proxy")?.to_string()),
|
||||
None => None,
|
||||
},
|
||||
status_url: Some(server_config.public_url.join("status")?.to_string()),
|
||||
cert_hash: None,
|
||||
any_server: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user