fix: use html audio to load stream
This commit is contained in:
@@ -155,16 +155,8 @@ 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,
|
||||
type: audioBlob.type
|
||||
audioBlob
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user