feat(voice): 百炼声音复刻create_voice + TTS instruction情绪驱动(主TTS-昔涟复刻音色)
This commit is contained in:
1 parent
73dabb9dde
commit
03d7050e1e
15 files changed
+686
-30
No files matched your search
@@ -190,6 +190,12 @@ func TestLoad_VoiceDefaults(t *testing.T) {
|
||||
if cfg.Voice.TTSSampleRate != 24000 {
|
||||
t.Errorf("TTSSampleRate = %d, want 24000", cfg.Voice.TTSSampleRate)
|
||||
}
|
||||
if cfg.Voice.VoiceTTSInstruction != "" {
|
||||
t.Errorf("VoiceTTSInstruction = %q, want empty (default)", cfg.Voice.VoiceTTSInstruction)
|
||||
}
|
||||
if cfg.Voice.VoiceClonePrefix != "cyrene" {
|
||||
t.Errorf("VoiceClonePrefix = %q, want cyrene (default)", cfg.Voice.VoiceClonePrefix)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoad_VoiceEnvOverrides(t *testing.T) {
|
||||
@@ -209,6 +215,23 @@ func TestLoad_VoiceEnvOverrides(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoad_VoiceCloneInstructionEnvOverrides(t *testing.T) {
|
||||
t.Setenv("JWT_SECRET", strings.Repeat("s", 40))
|
||||
t.Setenv("VOICE_TTS_INSTRUCTION", "语气开朗俏皮,像女朋友撒娇")
|
||||
t.Setenv("VOICE_CLONE_PREFIX", "xilian")
|
||||
|
||||
cfg, err := Load("")
|
||||
if err != nil {
|
||||
t.Fatalf("Load() error: %v", err)
|
||||
}
|
||||
if cfg.Voice.VoiceTTSInstruction != "语气开朗俏皮,像女朋友撒娇" {
|
||||
t.Errorf("VoiceTTSInstruction = %q, want the env instruction", cfg.Voice.VoiceTTSInstruction)
|
||||
}
|
||||
if cfg.Voice.VoiceClonePrefix != "xilian" {
|
||||
t.Errorf("VoiceClonePrefix = %q, want xilian", cfg.Voice.VoiceClonePrefix)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseDotEnv_QuotedAndExport(t *testing.T) {
|
||||
path := writeEnvFile(t, `export FOO=bar
|
||||
BAZ='quoted value'
|
||||
|
||||
Reference in new issue
Block a user