Merge pull request #1489 from omnivore-app/fix/tts-mismatched-language

Return status=500 if no audio data returned by synthesis api
This commit is contained in:
Hongbo Wu 2022-12-01 11:49:45 +08:00 committed by GitHub
commit 5e346740cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -322,7 +322,7 @@ export const textToSpeechStreamingHandler = Sentry.GCPFunction.wrapHttpFunction(
}
// synthesize text to speech if cache miss
const { audioData, speechMarks } = await synthesizeTextToSpeech(input)
if (!audioData) {
if (!audioData || audioData.length === 0) {
return res.status(500).send({ errorCode: 'SYNTHESIZER_ERROR' })
}