Concatenating 'audio/x-wav' buffer and serving with 'Transfer-Encoding': 'chunked'

血红的双手。 提交于 2019-12-03 21:40:55

I think your best bet is to make this resemble an audio stream, as would be sent by icecast/shoutcast. I don't think FireFox will handle that by default (older versions do not), which is why there are so many lovely flash plugins to play streams.

You need to set a few more headers to resemble a stream:

HTTP/1.0 200 OK
Content-Type: audio/wav
Transfer-Encoding: chunked
icy-br: ##
ice-audio-info:bitrate=##;samplerate=#####
icy-description:Some Name
icy-genre:Alternative
icy-name:Name
icy-pub:0
icy-url:http://yoursite.com
Server:Whatever you want
Cache-Control: no-cache
Connection: Keep-Alive

I don't know the answer to this, but have a look at how Shoutcast streams are coming across the wire. They are an infinitely long mp3 file, and similar concepts should apply if you take a look at how it's done.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!