pub enum SttError {
AudioFileError(String),
FileNotFound(String),
UnsupportedFormat(String),
WhisperError(String),
ModelLoadError(String),
TranscriptionError(String),
AudioProcessingError(String),
ResamplingError(String),
StreamError(String),
ConfigError(String),
IoError(Error),
Other(String),
}
Expand description
STT模块的主要错误类型
Variants§
AudioFileError(String)
音频文件相关错误
FileNotFound(String)
文件未找到错误
UnsupportedFormat(String)
音频格式不支持
WhisperError(String)
Whisper模型相关错误
ModelLoadError(String)
模型加载失败
TranscriptionError(String)
转录失败
AudioProcessingError(String)
音频处理错误
ResamplingError(String)
音频重采样错误
StreamError(String)
流处理错误
ConfigError(String)
配置错误
IoError(Error)
IO错误
Other(String)
其他错误
Implementations§
Source§impl SttError
错误辅助函数
impl SttError
错误辅助函数
Sourcepub fn file_not_found<S: Into<String>>(path: S) -> Self
pub fn file_not_found<S: Into<String>>(path: S) -> Self
创建文件未找到错误
Sourcepub fn unsupported_format<S: Into<String>>(format: S) -> Self
pub fn unsupported_format<S: Into<String>>(format: S) -> Self
创建不支持格式错误
Sourcepub fn model_load_error<S: Into<String>>(msg: S) -> Self
pub fn model_load_error<S: Into<String>>(msg: S) -> Self
创建模型加载错误
Sourcepub fn transcription_error<S: Into<String>>(msg: S) -> Self
pub fn transcription_error<S: Into<String>>(msg: S) -> Self
创建转录错误
Sourcepub fn config_error<S: Into<String>>(msg: S) -> Self
pub fn config_error<S: Into<String>>(msg: S) -> Self
创建配置错误
Trait Implementations§
Source§impl Error for SttError
impl Error for SttError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ResampleError> for SttError
从rubato错误转换
impl From<ResampleError> for SttError
从rubato错误转换
Source§fn from(err: ResampleError) -> Self
fn from(err: ResampleError) -> Self
Converts to this type from the input type.
Source§impl From<WhisperError> for SttError
从whisper-rs错误转换
impl From<WhisperError> for SttError
从whisper-rs错误转换
Source§fn from(err: WhisperError) -> Self
fn from(err: WhisperError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SttError
impl !RefUnwindSafe for SttError
impl Send for SttError
impl Sync for SttError
impl Unpin for SttError
impl !UnwindSafe for SttError
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