如何播放从 Bing Text to Speech API 返回的音频流?

How do I playback the audio stream returned from Bing Text to Speech API?

我正在使用文本到语音的 Azure 代码示例 API (https://github.com/Azure-Samples/Cognitive-Speech-TTS/tree/master/Samples-Http/PHP) returns 音频,但我不明白如何捕获流以进行播放在浏览器中?

我正在尝试在此处构建 Text to Speech 演示 https://azure.microsoft.com/en-us/services/cognitive-services/speech/

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

file_put_contents($speechfilenamemp,$result);