【问题标题】:How do I playback the audio stream returned from Bing Text to Speech API?如何播放从 Bing Text to Speech API 返回的音频流?
【发布时间】:2017-08-09 21:57:49
【问题描述】:

我正在使用 Azure 代码示例用于 Text to Speech API (https://github.com/Azure-Samples/Cognitive-Speech-TTS/tree/master/Samples-Http/PHP),它返回音频,但我不明白如何捕获流以在浏览器中播放?

我正在尝试在 https://azure.microsoft.com/en-us/services/cognitive-services/speech/ 此处构建文本转语音演示

【问题讨论】:

    标签: azure microsoft-cognitive azure-cognitive-services bing-speech


    【解决方案1】:

    使用 file_put_contents 从 API 获取输出并将内容流式传输到文件

    file_put_contents($speechfilenamemp,$result);
    

    【讨论】:

    • 奇怪的是,我尝试使用 Azure 文本转语音,但无法输出声音文件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-12
    • 2021-10-26
    • 1970-01-01
    • 1970-01-01
    • 2020-11-04
    • 1970-01-01
    • 2015-07-31
    相关资源
    最近更新 更多