pub struct NihilityListener { /* private fields */ }Expand description
助手项目中实时语音输入
Implementations§
Source§impl NihilityListener
impl NihilityListener
Sourcepub fn init_from_file_config() -> Result<Self, NihilityListenerError>
pub fn init_from_file_config() -> Result<Self, NihilityListenerError>
读取文件配置初始化语音输入实例
Sourcepub fn init(
config: NihilityListenerConfig,
) -> Result<Self, NihilityListenerError>
pub fn init( config: NihilityListenerConfig, ) -> Result<Self, NihilityListenerError>
根据配置初始化语音输入实例
Sourcepub fn get_sample_receiver(&self) -> Receiver<f32>
pub fn get_sample_receiver(&self) -> Receiver<f32>
获取音频输入采样管道接收者
Sourcepub fn get_probability_receiver(
&self,
) -> Result<Receiver<f32>, NihilityListenerError>
pub fn get_probability_receiver( &self, ) -> Result<Receiver<f32>, NihilityListenerError>
获取语音活动检测概率管道接收者
Sourcepub fn get_speech_receiver(&self) -> Receiver<Vec<f32>>
pub fn get_speech_receiver(&self) -> Receiver<Vec<f32>>
获取活动语音数据管道接收者
Sourcepub fn get_text_receiver(&self) -> Receiver<String>
pub fn get_text_receiver(&self) -> Receiver<String>
获取自动语音识别结果管道接收者
Sourcepub async fn run(&mut self) -> Result<(), NihilityListenerError>
pub async fn run(&mut self) -> Result<(), NihilityListenerError>
开始实时语音识别
Auto Trait Implementations§
impl !Freeze for NihilityListener
impl !RefUnwindSafe for NihilityListener
impl !UnwindSafe for NihilityListener
impl Send for NihilityListener
impl Sync for NihilityListener
impl Unpin for NihilityListener
impl UnsafeUnpin 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
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
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