简体   繁体   English

iOS通过网络流式传输音频-随机访问6小时的文件

[英]iOS streaming audio from network — random access of a 6-hour file

A potential client has come to me asking for a an app which will stream a six hour audio file. 一个潜在的客户来找我,要求一个应用程序,该应用程序将流式传输六个小时的音频文件。 The user needs to be able to set the "playback head" to any position along the file. 用户需要能够将“播放头”设置到文件中的任何位置。 Presumably, this means that the app must not be forced to download the entire file before it beings playing back starting at an arbitrary 据推测,这意味着在强制以任意方式开始播放之前,不得强迫该应用下载整个文件

An added complication -- there are actually four files which need to be streamed and mixed simultaneously. 更为复杂的是,实际上有四个文件需要同时流传输和混合。

My questions are: 我的问题是:

1) Is there an out-of-the box technology which will allow me random access of streaming audio, on iOS? 1)是否有开箱即用的技术可以让我在iOS上随机访问流音频? Can this be done with standard server technology and a single long file, or will it involve some fancy server tech? 可以使用标准服务器技术和单个长文件来完成此操作,还是会涉及一些高级服务器技术?

2) Which iOS framework is best suited for this. 2)哪个iOS框架最适合此。 Is there anything high-level that would allow me to easily mix these four audio files? 有什么高级的方法可以让我轻松地混合这四个音频文件吗?

3) Can this be done entirely with standard browser technology on the client side? 3)是否可以完全使用客户端上的标准浏览器技术来完成此操作? (ie HTML5) (即HTML5)

Have a close look at the MP3 format. 仔细看看MP3格式。 It is remarkably easy and efficient to parse, chop up into little bits, and reassemble into a custom stream. 解析,切成小块并重新组装成自定义流非常简单而有效。

Hence rolling your own server-side code to grab what you want and send to the client will not be as crazy or difficult as it may sound. 因此,滚动您自己的服务器端代码以获取想要的内容并将其发送给客户端将不会像听起来那样疯狂或困难。

MP3 is also widely supported by various clients. MP3也受到各种客户端的广泛支持。 I strongly suspect any HTML5 capable browser will be able of play the stream you generate via a long-lived bit-rate regulated HTTP request. 我强烈怀疑任何支持HTML5的浏览器都可以播放通过长期比特率调节的HTTP请求生成的流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM