如何服务/流式传输多个音频文件
我正在开发一个项目,其中有许多大约 500-600k 的小音频文件。然后是15M左右的音频文件。
15M 文件是完整的叙述性文章。较小的句子是文章中的单独句子。
未来将会有很多用户和很多文章。
我希望能够相对快速地加载音频文件——无论是通过预加载还是流式传输或类似的方式。基本上,如果用户单击按钮 - 我希望音频或多或少立即开始。
我在这里有什么选择?红5?冰铸?
编辑: 如果可能的话,我想避免使用 flash,但并不反对它——我绝对不能像我希望的那样使用 html5 音频。
我已经尝试过执行文档加载来发出文件的获取请求——每页通常有 15-20 个。 (19 个小文件,1 个大文件)。这似乎并不像我想象的那么有效。
在延迟方面——我正在寻找按钮式即时播放——现在我可以数到小文件的 2 或 3,以及大文件的 6-7。 Flash能做到这一点吗?
I'm working on a project where we have many small audio files of around 500-600k. Then there are audio files of around 15M.
The 15M files are full narrated articles. The smaller ones are individual sentences within the article.
There are going to be many users and many articles in the future.
I want to be able to load the audio files relatively fast -- either through pre-loading or streaming or something of that nature. Basically if a user clicks on a button -- I want the audio to start more or less immediately.
What are my options here? Red5? Icecast?
EDIT:
I'd like to avoid flash if at all possible but not opposed to it -- I definitely can't use html5 audio as much as I'd like too.
I've already tried doing document onload to issue get requests for the files -- there are usually 15-20 per page. (19 small files, one big one). That doesn't seem to work as well as I thought it might.
In terms of latency -- I'm looking for push-button instant play -- right now I can count to 2 or 3 for the small files and 6-7 for the big one. Flash would be able to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Icecast 等流媒体解决方案在这里不合适。您所需要的只是简单的 HTTP。
你没有提到你在客户端玩这些东西。如果您在 Flash 中执行此操作,则在下载仍在运行时预加载或播放相对简单。
对于音频压缩,您应该使用 MP3。对于语音,您可以轻松地使用较低的比特率。 48kbit 44.1kHz 单声道通常是可以接受的。即使在良好的移动连接上,这也能很好地加载。
无论如何,HTTP 是最佳选择。这样您就可以轻松请求单独的文件。 Icecast 适用于运行一段时间的单个流,例如网络广播。
Streaming solutions such as Icecast are not appropriate here. All you need is simple HTTP.
You don't mention what you are playing these things on the client side with. If you are doing this in flash, it is relatively simple to preload or play while the download is still running.
For audio compression, you should be using MP3. For speech, you can easily get away with a lower bitrate. 48kbit 44.1kHz Mono is generally acceptable. This will load fine, even on decent mobile connections.
In any case, HTTP is the way to go. That way you can request the separate files easily. Icecast is for a single stream that runs for awhile, such as internet radio.
好的 - 所以我做了一些调查并弄清楚竞争对手正在使用什么
:
http:// www.schillmania.com/projects/soundmanager2/
基本上,它所做的就是尝试使用 html5 音频标签,并设置非常有用的“preload=true”标志,如果不能做到这一点,它会回退到 Flash预加载 mp3
ok -- so i did some investigation and figured out what the competition was using
it was this:
http://www.schillmania.com/projects/soundmanager2/
basically what it does is try and use html5 audio tags with the ever so helpful 'preload=true' flag set and if it can't do that it fallsback on flash to preload the mp3