Merge branch 'gamer-kold/update-rodio-v2' into 'master'

Updated Rodio

See merge request veloren/veloren!4399
This commit is contained in:
Marcel 2024-03-31 09:05:18 +00:00
commit a955871f60
3 changed files with 98 additions and 215 deletions

305
Cargo.lock generated
View File

@ -86,14 +86,13 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
[[package]]
name = "alsa"
version = "0.6.0"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5915f52fe2cf65e83924d037b6c5290b7cee097c6b5c8700746e6168a343fd6b"
checksum = "37fe60779335388a88c01ac6c3be40304d1e349de3ada3b15f7808bb90fa9dce"
dependencies = [
"alsa-sys",
"bitflags 1.3.2",
"bitflags 2.5.0",
"libc",
"nix 0.23.2",
]
[[package]]
@ -223,7 +222,7 @@ version = "2.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7e7b35733e3a8c1ccb90385088dd5b6eaa61325cb4d1ad56e683b5224ff352e"
dependencies = [
"jni 0.21.1",
"jni",
"ndk-context",
"winapi",
"xdg",
@ -921,7 +920,7 @@ dependencies = [
"anstream",
"anstyle",
"clap_lex",
"strsim 0.11.0",
"strsim",
]
[[package]]
@ -1206,11 +1205,12 @@ dependencies = [
[[package]]
name = "coreaudio-rs"
version = "0.10.0"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88"
checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace"
dependencies = [
"bitflags 1.3.2",
"core-foundation-sys",
"coreaudio-sys",
]
@ -1225,27 +1225,25 @@ dependencies = [
[[package]]
name = "cpal"
version = "0.13.5"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74117836a5124f3629e4b474eed03e479abaf98988b4bb317e29f08cfe0e4116"
checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779"
dependencies = [
"alsa",
"core-foundation-sys",
"coreaudio-rs",
"jni 0.19.0",
"dasp_sample",
"jni",
"js-sys",
"lazy_static",
"libc",
"mach",
"ndk 0.6.0",
"ndk-glue",
"nix 0.23.2",
"mach2",
"ndk 0.8.0",
"ndk-context",
"oboe",
"parking_lot 0.11.2",
"stdweb",
"thiserror",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"winapi",
"windows 0.54.0",
]
[[package]]
@ -1517,7 +1515,7 @@ dependencies = [
"crossterm_winapi",
"libc",
"mio",
"parking_lot 0.12.1",
"parking_lot",
"signal-hook",
"signal-hook-mio",
"winapi",
@ -1615,38 +1613,14 @@ dependencies = [
"petgraph 0.4.13",
]
[[package]]
name = "darling"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"
dependencies = [
"darling_core 0.13.4",
"darling_macro 0.13.4",
]
[[package]]
name = "darling"
version = "0.20.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391"
dependencies = [
"darling_core 0.20.8",
"darling_macro 0.20.8",
]
[[package]]
name = "darling_core"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
dependencies = [
"fnv",
"ident_case",
"proc-macro2 1.0.79",
"quote 1.0.35",
"strsim 0.10.0",
"syn 1.0.109",
"darling_core",
"darling_macro",
]
[[package]]
@ -1662,28 +1636,23 @@ dependencies = [
"syn 2.0.53",
]
[[package]]
name = "darling_macro"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
dependencies = [
"darling_core 0.13.4",
"quote 1.0.35",
"syn 1.0.109",
]
[[package]]
name = "darling_macro"
version = "0.20.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f"
dependencies = [
"darling_core 0.20.8",
"darling_core",
"quote 1.0.35",
"syn 2.0.53",
]
[[package]]
name = "dasp_sample"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f"
[[package]]
name = "data-encoding"
version = "2.5.0"
@ -1818,7 +1787,7 @@ dependencies = [
"crossbeam-channel",
"data-encoding",
"num-traits",
"parking_lot 0.12.1",
"parking_lot",
"serde",
"serde_json",
"serde_repr",
@ -2019,7 +1988,7 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af"
dependencies = [
"darling 0.20.8",
"darling",
"proc-macro2 1.0.79",
"quote 1.0.35",
"syn 2.0.53",
@ -2037,7 +2006,7 @@ dependencies = [
"ecolor",
"emath",
"nohash-hasher",
"parking_lot 0.12.1",
"parking_lot",
]
[[package]]
@ -2888,7 +2857,7 @@ dependencies = [
"ipconfig",
"lru-cache",
"once_cell",
"parking_lot 0.12.1",
"parking_lot",
"rand 0.8.5",
"resolv-conf",
"smallvec",
@ -3330,20 +3299,6 @@ dependencies = [
"cc",
]
[[package]]
name = "jni"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec"
dependencies = [
"cesu8",
"combine",
"jni-sys",
"log",
"thiserror",
"walkdir",
]
[[package]]
name = "jni"
version = "0.21.1"
@ -3928,19 +3883,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "ndk"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4"
dependencies = [
"bitflags 1.3.2",
"jni-sys",
"ndk-sys 0.3.0",
"num_enum 0.5.11",
"thiserror",
]
[[package]]
name = "ndk"
version = "0.7.0"
@ -3955,49 +3897,26 @@ dependencies = [
"thiserror",
]
[[package]]
name = "ndk"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7"
dependencies = [
"bitflags 2.5.0",
"jni-sys",
"log",
"ndk-sys 0.5.0+25.2.9519653",
"num_enum 0.7.2",
"thiserror",
]
[[package]]
name = "ndk-context"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
[[package]]
name = "ndk-glue"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f"
dependencies = [
"lazy_static",
"libc",
"log",
"ndk 0.6.0",
"ndk-context",
"ndk-macro",
"ndk-sys 0.3.0",
]
[[package]]
name = "ndk-macro"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c"
dependencies = [
"darling 0.13.4",
"proc-macro-crate",
"proc-macro2 1.0.79",
"quote 1.0.35",
"syn 1.0.109",
]
[[package]]
name = "ndk-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97"
dependencies = [
"jni-sys",
]
[[package]]
name = "ndk-sys"
version = "0.4.1+23.1.7779620"
@ -4007,6 +3926,15 @@ dependencies = [
"jni-sys",
]
[[package]]
name = "ndk-sys"
version = "0.5.0+25.2.9519653"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691"
dependencies = [
"jni-sys",
]
[[package]]
name = "nibble_vec"
version = "0.1.0"
@ -4016,19 +3944,6 @@ dependencies = [
"smallvec",
]
[[package]]
name = "nix"
version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"
dependencies = [
"bitflags 1.3.2",
"cc",
"cfg-if 1.0.0",
"libc",
"memoffset 0.6.5",
]
[[package]]
name = "nix"
version = "0.24.3"
@ -4217,17 +4132,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "num-derive"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
dependencies = [
"proc-macro2 1.0.79",
"quote 1.0.35",
"syn 1.0.109",
]
[[package]]
name = "num-derive"
version = "0.4.2"
@ -4321,6 +4225,15 @@ dependencies = [
"num_enum_derive 0.6.1",
]
[[package]]
name = "num_enum"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
dependencies = [
"num_enum_derive 0.7.2",
]
[[package]]
name = "num_enum_derive"
version = "0.5.11"
@ -4345,6 +4258,18 @@ dependencies = [
"syn 2.0.53",
]
[[package]]
name = "num_enum_derive"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [
"proc-macro-crate",
"proc-macro2 1.0.79",
"quote 1.0.35",
"syn 2.0.53",
]
[[package]]
name = "number_prefix"
version = "0.4.0"
@ -4430,23 +4355,23 @@ dependencies = [
[[package]]
name = "oboe"
version = "0.4.6"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27f63c358b4fa0fbcfefd7c8be5cfc39c08ce2389f5325687e7762a48d30a5c1"
checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb"
dependencies = [
"jni 0.19.0",
"ndk 0.6.0",
"jni",
"ndk 0.8.0",
"ndk-context",
"num-derive 0.3.3",
"num-derive",
"num-traits",
"oboe-sys",
]
[[package]]
name = "oboe-sys"
version = "0.4.5"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3370abb7372ed744232c12954d920d1a40f1c4686de9e79e800021ef492294bd"
checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d"
dependencies = [
"cc",
]
@ -4554,17 +4479,6 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
[[package]]
name = "parking_lot"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
dependencies = [
"instant",
"lock_api",
"parking_lot_core 0.8.6",
]
[[package]]
name = "parking_lot"
version = "0.12.1"
@ -4572,21 +4486,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core 0.9.9",
]
[[package]]
name = "parking_lot_core"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
dependencies = [
"cfg-if 1.0.0",
"instant",
"libc",
"redox_syscall 0.2.16",
"smallvec",
"winapi",
"parking_lot_core",
]
[[package]]
@ -4879,7 +4779,7 @@ dependencies = [
"fnv",
"lazy_static",
"memchr",
"parking_lot 0.12.1",
"parking_lot",
"thiserror",
]
@ -5154,15 +5054,6 @@ dependencies = [
"yasna",
]
[[package]]
name = "redox_syscall"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
"bitflags 1.3.2",
]
[[package]]
name = "redox_syscall"
version = "0.3.5"
@ -5362,9 +5253,9 @@ dependencies = [
[[package]]
name = "rodio"
version = "0.15.0"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0939e9f626e6c6f1989adb6226a039c855ca483053f0ee7c98b90e41cf731e"
checksum = "3b1bb7b48ee48471f55da122c0044fcc7600cfcc85db88240b89cb832935e611"
dependencies = [
"cpal",
"lewton",
@ -6130,12 +6021,6 @@ dependencies = [
"byteorder",
]
[[package]]
name = "stdweb"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e"
[[package]]
name = "str-buf"
version = "1.0.6"
@ -6148,12 +6033,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
[[package]]
name = "strsim"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "strsim"
version = "0.11.0"
@ -6986,7 +6865,7 @@ dependencies = [
"itertools 0.10.5",
"kiddo",
"lazy_static",
"num-derive 0.4.2",
"num-derive",
"num-traits",
"ordered-float 3.9.2",
"petgraph 0.6.4",
@ -7233,7 +7112,7 @@ dependencies = [
"lazy_static",
"noise",
"num_cpus",
"parking_lot 0.12.1",
"parking_lot",
"portpicker",
"prometheus",
"quinn",
@ -8160,7 +8039,7 @@ dependencies = [
"js-sys",
"log",
"naga",
"parking_lot 0.12.1",
"parking_lot",
"profiling",
"raw-window-handle 0.5.2",
"serde",
@ -8185,7 +8064,7 @@ dependencies = [
"codespan-reporting",
"log",
"naga",
"parking_lot 0.12.1",
"parking_lot",
"profiling",
"raw-window-handle 0.5.2",
"ron",
@ -8226,7 +8105,7 @@ dependencies = [
"naga",
"objc",
"once_cell",
"parking_lot 0.12.1",
"parking_lot",
"profiling",
"range-alloc",
"raw-window-handle 0.5.2",

View File

@ -116,7 +116,7 @@ ordered-float = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
rayon = { workspace = true }
rodio = {version = "0.15", default-features = false, features = ["vorbis"]}
rodio = {version = "0.17", default-features = false, features = ["vorbis"]}
ron = { workspace = true }
serde = { workspace = true, features = [ "rc" ]}
slab = { workspace = true }

View File

@ -20,7 +20,7 @@ use crate::audio::{
fader::{FadeDirection, Fader},
Listener,
};
use rodio::{OutputStreamHandle, Sample, Sink, Source, SpatialSink};
use rodio::{cpal::FromSample, OutputStreamHandle, Sample, Sink, Source, SpatialSink};
use serde::Deserialize;
use std::time::Instant;
use strum::EnumIter;
@ -88,6 +88,7 @@ impl MusicChannel {
S::Item: Sample,
S::Item: Send,
<S as Iterator>::Item: std::fmt::Debug,
f32: FromSample<<S as Iterator>::Item>,
{
self.tag = tag;
self.sink.append(source);
@ -208,6 +209,7 @@ impl AmbientChannel {
S::Item: Sample,
S::Item: Send,
<S as Iterator>::Item: std::fmt::Debug,
f32: FromSample<<S as Iterator>::Item>,
{
self.sink.append(source);
}
@ -248,6 +250,7 @@ impl SfxChannel {
S::Item: Sample,
S::Item: Send,
<S as Iterator>::Item: std::fmt::Debug,
f32: FromSample<<S as Iterator>::Item>,
{
self.sink.append(source);
}
@ -305,6 +308,7 @@ impl UiChannel {
S::Item: Sample,
S::Item: Send,
<S as Iterator>::Item: std::fmt::Debug,
f32: FromSample<<S as Iterator>::Item>,
{
self.sink.append(source);
}