Struct rustpotter_wasm::RustpotterJS
source · [−]pub struct RustpotterJS { /* private fields */ }
Implementations
sourceimpl RustpotterJS
impl RustpotterJS
sourcepub fn addWakewordModelBytes(&mut self, data: Vec<u8>)
pub fn addWakewordModelBytes(&mut self, data: Vec<u8>)
Loads a wakeword from its model bytes.
sourcepub fn processInt32(&mut self, buffer: &[i32]) -> Option<RustpotterDetection>
pub fn processInt32(&mut self, buffer: &[i32]) -> Option<RustpotterDetection>
Process i32 audio chunks.
Asserts that the audio chunk length should match the return of the get_samples_per_frame method.
Assumes sample rate match the configured for the detector.
Asserts that detector bits_per_sample is one of: 8, 16, 24, 32.
Asserts that detector sample_format is ‘int’.
sourcepub fn processInt16(&mut self, buffer: &[i16]) -> Option<RustpotterDetection>
pub fn processInt16(&mut self, buffer: &[i16]) -> Option<RustpotterDetection>
Process i16 audio chunks.
Asserts that the audio chunk length should match the return of the get_samples_per_frame method.
Assumes sample rate match the configured for the detector.
Asserts that detector bits_per_sample is one of: 8, 16.
Asserts that detector sample_format is ‘int’.
sourcepub fn processInt8(&mut self, buffer: &[i8]) -> Option<RustpotterDetection>
pub fn processInt8(&mut self, buffer: &[i8]) -> Option<RustpotterDetection>
Process i8 audio chunks.
Asserts that the audio chunk length should match the return of the get_samples_per_frame method.
Assumes sample rate match the configured for the detector.
Asserts that detector bits_per_sample is 8.
Asserts that detector sample_format is ‘int’.
sourcepub fn processFloat32(&mut self, buffer: &[f32]) -> Option<RustpotterDetection>
pub fn processFloat32(&mut self, buffer: &[f32]) -> Option<RustpotterDetection>
Process f32 audio chunks.
Asserts that the audio chunk length should match the return of the get_samples_per_frame method.
Assumes sample rate match the configured for the detector.
Asserts that detector bits_per_sample is 32.
Asserts that detector sample_format is ‘float’.
sourcepub fn getFrameSize(&self) -> usize
pub fn getFrameSize(&self) -> usize
Returns the desired chunk size.
Trait Implementations
sourceimpl From<RustpotterJS> for JsValue
impl From<RustpotterJS> for JsValue
sourcefn from(value: RustpotterJS) -> Self
fn from(value: RustpotterJS) -> Self
Converts to this type from the input type.
sourceimpl FromWasmAbi for RustpotterJS
impl FromWasmAbi for RustpotterJS
sourceimpl IntoWasmAbi for RustpotterJS
impl IntoWasmAbi for RustpotterJS
sourceimpl OptionFromWasmAbi for RustpotterJS
impl OptionFromWasmAbi for RustpotterJS
sourceimpl OptionIntoWasmAbi for RustpotterJS
impl OptionIntoWasmAbi for RustpotterJS
sourceimpl RefFromWasmAbi for RustpotterJS
impl RefFromWasmAbi for RustpotterJS
type Anchor = Ref<'static, RustpotterJS>
type Anchor = Ref<'static, RustpotterJS>
The type that holds the reference to Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
sourceunsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
sourceimpl RefMutFromWasmAbi for RustpotterJS
impl RefMutFromWasmAbi for RustpotterJS
type Anchor = RefMut<'static, RustpotterJS>
type Anchor = RefMut<'static, RustpotterJS>
Same as RefFromWasmAbi::Anchor
sourceunsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as RefFromWasmAbi::ref_from_abi
sourceimpl WasmDescribe for RustpotterJS
impl WasmDescribe for RustpotterJS
Auto Trait Implementations
impl !RefUnwindSafe for RustpotterJS
impl Send for RustpotterJS
impl Sync for RustpotterJS
impl Unpin for RustpotterJS
impl !UnwindSafe for RustpotterJS
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcefn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more