Updated Rodio

This commit is contained in:
Talha Qamar 2024-03-12 11:01:21 +05:00
parent 3ce82874a3
commit 028ca816b7
3 changed files with 6 additions and 8969 deletions

8968
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -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 }

@ -21,6 +21,7 @@ use crate::audio::{
Listener,
};
use rodio::{OutputStreamHandle, Sample, Sink, Source, SpatialSink};
use rodio::cpal::FromSample;
use serde::Deserialize;
use std::time::Instant;
use strum::EnumIter;
@ -88,6 +89,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 +210,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 +251,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 +309,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);
}