pub struct PpgConverter { /* private fields */ }Expand description
PPG (Phonetic Posteriorgram) based voice converter.
Uses ASR-derived phonetic features as the content bottleneck:
- More explicit phonetic representation
- Better for cross-lingual conversion
- Requires pre-trained ASR model for PPG extraction
Implementations§
Source§impl PpgConverter
impl PpgConverter
Sourcepub fn new(config: VoiceConversionConfig, num_phonemes: usize) -> PpgConverter
pub fn new(config: VoiceConversionConfig, num_phonemes: usize) -> PpgConverter
Create a new PPG-based converter
Sourcepub fn default_ppg() -> PpgConverter
pub fn default_ppg() -> PpgConverter
Create with default PPG config
Sourcepub fn num_phonemes(&self) -> usize
pub fn num_phonemes(&self) -> usize
Get number of phoneme classes
Trait Implementations§
Source§impl Clone for PpgConverter
impl Clone for PpgConverter
Source§fn clone(&self) -> PpgConverter
fn clone(&self) -> PpgConverter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PpgConverter
impl Debug for PpgConverter
Source§impl Default for PpgConverter
impl Default for PpgConverter
Source§fn default() -> PpgConverter
fn default() -> PpgConverter
Returns the “default value” for a type. Read more
Source§impl VoiceConverter for PpgConverter
impl VoiceConverter for PpgConverter
Source§fn config(&self) -> &VoiceConversionConfig
fn config(&self) -> &VoiceConversionConfig
Get the configuration
Source§fn convert(
&self,
source_audio: &[f32],
_source_embedding: Option<&SpeakerEmbedding>,
target_embedding: &SpeakerEmbedding,
) -> Result<ConversionResult, VoiceError>
fn convert( &self, source_audio: &[f32], _source_embedding: Option<&SpeakerEmbedding>, target_embedding: &SpeakerEmbedding, ) -> Result<ConversionResult, VoiceError>
Convert voice using speaker embeddings. Read more
Source§fn extract_content(&self, audio: &[f32]) -> Result<Vec<Vec<f32>>, VoiceError>
fn extract_content(&self, audio: &[f32]) -> Result<Vec<Vec<f32>>, VoiceError>
Extract content features from audio (speaker-independent). Read more
Source§fn synthesize(
&self,
content: &[Vec<f32>],
_speaker: &SpeakerEmbedding,
) -> Result<Vec<f32>, VoiceError>
fn synthesize( &self, content: &[Vec<f32>], _speaker: &SpeakerEmbedding, ) -> Result<Vec<f32>, VoiceError>
Synthesize audio from content features and speaker embedding. Read more
Auto Trait Implementations§
impl Freeze for PpgConverter
impl RefUnwindSafe for PpgConverter
impl Send for PpgConverter
impl Sync for PpgConverter
impl Unpin for PpgConverter
impl UnsafeUnpin for PpgConverter
impl UnwindSafe for PpgConverter
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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