Struct porcupine_sys::Object [−][src]
pub struct Object { /* fields omitted */ }
Methods
impl Object
[src]
impl Object
pub unsafe fn new(
model_file_path: &str,
keyword_file_path: &str,
sensitivity: f32
) -> Result<Self, Status>
[src]
pub unsafe fn new(
model_file_path: &str,
keyword_file_path: &str,
sensitivity: f32
) -> Result<Self, Status>
Creates a new Porcupine object.
pub unsafe fn new_multiple_keywords(
model_file_path: &str,
keyword_file_paths: &[&str],
sensitivities: &[f32]
) -> Result<Self, Status>
[src]
pub unsafe fn new_multiple_keywords(
model_file_path: &str,
keyword_file_paths: &[&str],
sensitivities: &[f32]
) -> Result<Self, Status>
Creates a new Porcupine object that is capable of detecting multiple keywords.
pub unsafe fn delete(&mut self)
[src]
pub unsafe fn delete(&mut self)
Delete the Porcupine object.
pub unsafe fn process(&self, pcm: &[i16]) -> Result<bool, Status>
[src]
pub unsafe fn process(&self, pcm: &[i16]) -> Result<bool, Status>
Detect keyword within the provided audio data. The data must be 16-bit linearly-encoded and single-channel with sample rate equal to sample_rate()
.
pub unsafe fn process_multiple_keywords(
&self,
pcm: &[i16]
) -> Result<isize, Status>
[src]
pub unsafe fn process_multiple_keywords(
&self,
pcm: &[i16]
) -> Result<isize, Status>
Detect one of the keywords within the provided audio data. The data must be 16-bit linearly-encoded and single-channel with sample rate equal to sample_rate()
. It returns the index of the detected keyword if successful.