pub struct ReferenceVoiceDatabase { /* private fields */ }Expand description
Reference voice database for zero-shot learning
Implementations§
Source§impl ReferenceVoiceDatabase
impl ReferenceVoiceDatabase
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty reference voice database.
§Returns
A new ReferenceVoiceDatabase instance with empty collections and initialized metadata.
Sourcepub fn add_voice(&mut self, voice: ReferenceVoice) -> Result<()>
pub fn add_voice(&mut self, voice: ReferenceVoice) -> Result<()>
Sourcepub fn remove_voice(&mut self, speaker_id: &str) -> Result<()>
pub fn remove_voice(&mut self, speaker_id: &str) -> Result<()>
Sourcepub fn find_similar_voices(
&self,
target_characteristics: &VoiceCharacteristics,
max_voices: usize,
) -> Result<Vec<ReferenceVoice>>
pub fn find_similar_voices( &self, target_characteristics: &VoiceCharacteristics, max_voices: usize, ) -> Result<Vec<ReferenceVoice>>
Finds the most similar reference voices based on target characteristics.
§Arguments
target_characteristics- The target voice characteristics to match againstmax_voices- Maximum number of similar voices to return
§Returns
A vector of reference voices sorted by similarity (most similar first), limited to max_voices.
§Errors
Currently does not return errors, but returns Result for future error handling.
Sourcepub fn metadata(&self) -> &DatabaseMetadata
pub fn metadata(&self) -> &DatabaseMetadata
Returns a reference to the database metadata.
Provides access to database statistics, version information, and index performance metrics.
§Returns
A reference to the DatabaseMetadata containing information about the database state,
including total voices, duration, supported languages, and search performance metrics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReferenceVoiceDatabase
impl RefUnwindSafe for ReferenceVoiceDatabase
impl Send for ReferenceVoiceDatabase
impl Sync for ReferenceVoiceDatabase
impl Unpin for ReferenceVoiceDatabase
impl UnsafeUnpin for ReferenceVoiceDatabase
impl UnwindSafe for ReferenceVoiceDatabase
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<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