Trait oc2_hlapi::device::SoundInterface

source ·
pub trait SoundInterface: RpcDevice {
    // Required methods
    fn find_sound(&self, name: &str) -> Result<Box<[String]>>;
    fn play_sound(&self, name: &str, volume: f64, pitch: f64) -> Result<()>;
}
Expand description

An interface between sound-making devices and the HALPI

Required Methods§

source

fn find_sound(&self, name: &str) -> Result<Box<[String]>>

Returns a slice of sound effect names matching the given name. The length of the slice is limited, so very generic names may result in a truncated list.

source

fn play_sound(&self, name: &str, volume: f64, pitch: f64) -> Result<()>

Plays the sound effect matching the given name at the given volume and pitch.

Object Safety§

This trait is not object safe.

Implementors§