fix(style): stt loading

This commit is contained in:
jialin
2024-11-29 22:10:52 +08:00
parent 1ac3768468
commit 412c6dadca
4 changed files with 26 additions and 19 deletions
+6
View File
@@ -98,6 +98,12 @@ export const textToSpeech = async (params: any, options?: any) => {
}
const audioBlob = await res.blob();
if (audioBlob?.type?.indexOf('audio') === -1) {
return {
url: '',
type: ''
};
}
const audioUrl = audioBlob.size > 0 ? URL.createObjectURL(audioBlob) : '';
return {
url: audioUrl,