crate::ix!();
#[derive(Getters, Builder, Debug, Clone)]
#[builder(name = "BatchModeTtsJobBuilder", pattern = "owned")]
#[getset(get = "pub")]
pub struct BatchModeTtsJob {
input_path: PathBuf,
output_path: PathBuf,
#[builder(setter(strip_option), default)]
work_dir: Option<PathBuf>,
#[builder(default = "3500")]
chunk_chars: usize,
#[builder(default = "SpeechModel::Tts1")]
model: SpeechModel,
#[builder(default = "Voice::Sage")]
voice: Voice,
#[builder(default = "SpeechResponseFormat::Mp3")]
response_format: SpeechResponseFormat,
#[builder(default = "1.0")]
speed: f32,
}
impl BatchModeTtsJob {
pub fn ext_for_format(fmt: SpeechResponseFormat) -> &'static str {
match fmt {
SpeechResponseFormat::Mp3 => "mp3",
SpeechResponseFormat::Opus => "ogg",
SpeechResponseFormat::Aac => "aac",
SpeechResponseFormat::Flac => "flac",
SpeechResponseFormat::Pcm => "pcm",
SpeechResponseFormat::Wav => "wav",
}
}
}