summaryrefslogtreecommitdiff
path: root/makima/src/tts/qwen3/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/tts/qwen3/mod.rs')
-rw-r--r--makima/src/tts/qwen3/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/makima/src/tts/qwen3/mod.rs b/makima/src/tts/qwen3/mod.rs
index c55c118..9bac794 100644
--- a/makima/src/tts/qwen3/mod.rs
+++ b/makima/src/tts/qwen3/mod.rs
@@ -30,6 +30,7 @@ pub mod speech_tokenizer;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering};
+use std::sync::Arc;
use candle_core::{DType, Device};
use candle_nn::VarBuilder;
@@ -168,6 +169,7 @@ impl Qwen3Tts {
text: &str,
reference_audio: Option<&[f32]>,
gen_config: Option<GenerationConfig>,
+ cancel_flag: Option<Arc<AtomicBool>>,
) -> Result<Vec<AudioChunk>, TtsError> {
let config = gen_config.unwrap_or_default();
@@ -178,6 +180,7 @@ impl Qwen3Tts {
&self.tokenizer,
&self.device,
config,
+ cancel_flag,
);
ctx.generate(text, reference_audio)
@@ -250,11 +253,12 @@ impl TtsEngine for Qwen3Tts {
text: &str,
reference_audio: Option<&[f32]>,
_reference_sample_rate: Option<u32>,
+ cancel_flag: Option<Arc<AtomicBool>>,
) -> Result<Vec<AudioChunk>, TtsError> {
// Note: reference audio should already be resampled to 24kHz
// by the caller. If a different sample rate is provided,
// the caller should resample using `resample_to_24k()`.
- self.generate_speech(text, reference_audio, None)
+ self.generate_speech(text, reference_audio, None, cancel_flag)
}
fn is_ready(&self) -> bool {