流的MP3,而被在服务器上生成它 [英] Streaming mp3 while it is being generated on the server

查看:132
本文介绍了流的MP3,而被在服务器上生成它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网络服务器流通过JavaScript / HTML5或Flash的MP3。
的JavaScript / HTML前端调用它开始产生一个mp3文件服务器上的脚本。

I am trying to stream an mp3 via javascript/html5 or flash on my webserver. The javascript/html front end calls a script on the server which begins generating an mp3 file.

我想要的文件开始播放后立即足够的音频缓冲,并继续播放。

I want the file to begin playback immediately once enough audio is buffered, and to continue playing.

我是新来的流,想知道最好的方法来做到这一点无论在Apache服务器和Windows IIS。

I am new to streaming and want to know the best method to do this in both apache server and windows iis.

起初,我以为我会需要使用一个实际的流协议,如RTP或RTSP,但现在看来似乎可能更好地使用自定义JavaScript播放器,把MP3文件中通过HTTP。
然而,随着HTTP值得关注​​的是,一旦MP3文件不完整的尾巴被击中文件传输将停止。有没有解决的办法,也许改变配置,使阿帕奇/ IIS服务器等到该文件终止传输之前完成?

At first I thought I would need to use an actual streaming protocol, such as rtp or rtsp, but it seems like it maybe better using a custom javascript player that takes the mp3 file in via http. However the concern with http is that the file transfer will stop once the incomplete tail of the mp3 file is hit. Is there a way around this, perhaps altering the config to make the apache/iis server wait until the file is complete before terminating the transfer?

我也看了成m3u格式的文件,但这似乎需要一个完整的MP3文件,虽然我不明确。

I also looked into m3u files but this seems to require a complete mp3 file, although I'm not clear on it.

任何意见/解决方案/例子将AP preciated。

Any advice/solutions/examples will be appreciated.

推荐答案

我没有确切的解决方案,但你可以试试这个的http://learningsfromdotnet.blogspot.com/2011/11/playing-mp3-using-audio-tag-html-5-in.html.

I don't have the exact solution, but you can try this http://learningsfromdotnet.blogspot.com/2011/11/playing-mp3-using-audio-tag-html-5-in.html.

我试图从IIS服务器流式传输的MP3文件,有问题使用Chrome,因为它与范围头的请求。如果你可以让类似的要求与范围标题,并从服务器流片的MP3,它可能工作。

I was trying to stream MP3 file from IIS server, had issue with Chrome because it makes a request with "Range" header. If you can make similar request with "Range" header and from server stream the piece of MP3, it might work.

这篇关于流的MP3,而被在服务器上生成它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆