diff --git a/common/audio_lm_family_codebook.cpp b/common/audio_lm_family_codebook.cpp index 8fd14ca..a329f76 100644 --- a/common/audio_lm_family_codebook.cpp +++ b/common/audio_lm_family_codebook.cpp @@ -23,7 +23,8 @@ class codebook_family : public alm_family { out->takes_ref_audio = audio_lm_codec_can_speaker_from_audio(alm_); out->takes_ref_text = out->takes_ref_audio && audio_lm_talker_has_projection(alm_); out->takes_instruct = meta_true("codec.lm.qwen3tts.takes_instruct"); - out->needs_voice = audio_lm_talker_has_projection(alm_) && !talker_voice(audio_lm_decode_speaker(alm_)); + // The model's default voice, not the last request's (decode_speaker). + out->needs_voice = audio_lm_talker_has_projection(alm_) && !talker_voice(audio_lm_resolve_speaker(alm_, nullptr)); const char * sr = audio_lm_meta_str(alm_, "codec.sample_rate"); out->sample_rate = sr ? std::atoi(sr) : 24000; } diff --git a/tests/e2e/audio_lm_host_smoke.py b/tests/e2e/audio_lm_host_smoke.py index 074f773..cea990f 100644 --- a/tests/e2e/audio_lm_host_smoke.py +++ b/tests/e2e/audio_lm_host_smoke.py @@ -219,6 +219,7 @@ def main() -> int: alm = codec_cpp.AudioLM(case["codec"], backbone_path=case["backbone"] if case.get("backbone_path") else None) bb = Backbone(case["backbone"], alm, max_frames=400) try: + caps = alm.caps req = {} if "ref" in case: # a cloned voice: create, save, reload wav, txt = case["ref"] @@ -229,6 +230,8 @@ def main() -> int: voice = alm.load_voice(Path(d) / "voice.gguf") req["voice"] = voice audio, sr, frames, stop = synthesize(alm, bb, case["text"], case["sampling"], **req) + # Caps describe the model, not the last request's voice. + assert alm.caps == caps, f"caps changed after a generation: {caps} -> {alm.caps}" except Exception as e: print(f"[FAIL] {name}: {e}") failed += 1