pub struct MultiRoomEnvironment {
pub rooms: HashMap<String, Room>,
pub connections: Vec<RoomConnection>,
pub global_config: GlobalAcousticConfig,
/* private fields */
}Expand description
Multi-room environment system
Fields§
§rooms: HashMap<String, Room>Individual rooms in the environment
connections: Vec<RoomConnection>Connections between rooms (doors, openings, etc.)
global_config: GlobalAcousticConfigGlobal acoustic properties
Implementations§
Source§impl MultiRoomEnvironment
impl MultiRoomEnvironment
Sourcepub fn add_connection(&mut self, connection: RoomConnection) -> Result<()>
pub fn add_connection(&mut self, connection: RoomConnection) -> Result<()>
Add connection between rooms
Sourcepub async fn process_multi_room_audio(
&mut self,
source_room_id: &str,
source_position: Position3D,
listener_room_id: &str,
listener_position: Position3D,
input_audio: &Array1<f32>,
sample_rate: u32,
) -> Result<(Array1<f32>, Array1<f32>)>
pub async fn process_multi_room_audio( &mut self, source_room_id: &str, source_position: Position3D, listener_room_id: &str, listener_position: Position3D, input_audio: &Array1<f32>, sample_rate: u32, ) -> Result<(Array1<f32>, Array1<f32>)>
Calculate multi-room acoustic propagation
Sourcepub fn get_room_mut(&mut self, room_id: &str) -> Option<&mut Room>
pub fn get_room_mut(&mut self, room_id: &str) -> Option<&mut Room>
Get room by ID (mutable)
Sourcepub fn set_connection_state(
&mut self,
connection_id: &str,
state: ConnectionState,
) -> Result<()>
pub fn set_connection_state( &mut self, connection_id: &str, state: ConnectionState, ) -> Result<()>
Update connection state
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiRoomEnvironment
impl RefUnwindSafe for MultiRoomEnvironment
impl Send for MultiRoomEnvironment
impl Sync for MultiRoomEnvironment
impl Unpin for MultiRoomEnvironment
impl UnsafeUnpin for MultiRoomEnvironment
impl UnwindSafe for MultiRoomEnvironment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more