pub struct NihilityListener { /* private fields */ }Expand description
助手项目中实时语音输入
Implementations§
Source§impl NihilityListener
impl NihilityListener
Sourcepub fn init_from_file_config() -> Result<Self, NihilityAsrError>
pub fn init_from_file_config() -> Result<Self, NihilityAsrError>
读取文件配置初始化语音输入实例
Sourcepub fn init(config: NihilityListenerConfig) -> Result<Self, NihilityAsrError>
pub fn init(config: NihilityListenerConfig) -> Result<Self, NihilityAsrError>
根据配置初始化语音输入实例
pub fn get_sample_receiver(&self) -> Receiver<f32>
pub fn get_probability_receiver( &self, ) -> Result<Receiver<f32>, NihilityAsrError>
pub fn get_speech_receiver(&self) -> Receiver<Vec<f32>>
pub fn get_text_receiver(&self) -> Receiver<String>
Sourcepub async fn start(&mut self) -> Result<(), NihilityAsrError>
pub async fn start(&mut self) -> Result<(), NihilityAsrError>
开始实时语音识别
Auto Trait Implementations§
impl !Freeze for NihilityListener
impl !RefUnwindSafe for NihilityListener
impl Send for NihilityListener
impl Sync for NihilityListener
impl Unpin for NihilityListener
impl !UnwindSafe for NihilityListener
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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