Trait oc2_hlapi::device::SoundInterface
source · pub trait SoundInterface: RpcDevice {
// Required methods
fn find_sound(&self, name: &str) -> Result<Box<[String]>>
where Box<[String]>: DeserializeOwned + 'static;
fn play_sound(&self, name: &str, volume: f64, pitch: f64) -> Result<()>
where (): DeserializeOwned + 'static;
}Expand description
An interface between sound-making devices and the HALPI
Required Methods§
sourcefn find_sound(&self, name: &str) -> Result<Box<[String]>>
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.
sourcefn play_sound(&self, name: &str, volume: f64, pitch: f64) -> Result<()>where
(): DeserializeOwned + 'static,
fn play_sound(&self, name: &str, volume: f64, pitch: f64) -> Result<()>where
(): DeserializeOwned + 'static,
Plays the sound effect matching the given name at the given volume and pitch.
Object Safety§
This trait is not object safe.