fix google custom voice can not be used without voice cloning key (#968)

This commit is contained in:
Hoan Luu Huu
2024-11-11 19:24:40 +07:00
committed by GitHub
parent 7615509e0b
commit 5be3a910ad

View File

@@ -95,7 +95,7 @@ class TtsTask extends Task {
} else if (vendor === 'playht') {
credentials = credentials || {};
credentials.voice_engine = this.options.voice_engine || credentials.voice_engine;
} else if (vendor === 'google' && voice.startsWith('custom_')) {
} else if (vendor === 'google' && typeof voice === 'string' && voice.startsWith('custom_')) {
const {lookupGoogleCustomVoice} = dbUtils(this.logger, cs.srf);
const arr = /custom_(.*)/.exec(voice);
if (arr) {