Article From:

You want to call the voice synthesis interface on the H5 page, using Baidu’s rest API, (not knowing you can do it), and ask for a binary voice file by document, but don’t know how to use it.
According to the document, the header information is Content-type: audio/mp3, even if it is successful.

Corresponding information

How can I analyze the audio and read it out, or do I use the wrong way? Ask the big God to give a plan or method

Answer 0:

Knowledge point: blob

    const blob = new Blob([res],{type:"audio/mp3"});
    const blobUrl = URL.createObjectURL(blob);
    const audio = new Audio(blobUrl);;

Leave a Reply

Your email address will not be published. Required fields are marked *