如何流过互联网半直播音频 [英] How to stream semi-live audio over internet

查看:141
本文介绍了如何流过互联网半直播音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要写的东西如Skype,即我有一台计算机上恒定的音频流,然后的 RECOM preSS 的它的格式是适合潜伏互联网连接,就接受它另一端和播放。

I want to write something like Skype, i.e. I have a constant audio stream on one computer and then recompress it in a format that's suitable for a latent internet connection, receive it on the other end and play it.

让我们也假设了互联网连接是相当现代的,快速的,即DSL或相似的,通过电话和没有这样的连接速度慢。所涉及的电脑也将是相当现代(双核英特尔​​CPU为2GHz或以上)。

Let's also assume that the internet connection is fairly modern and fast, i.e. DSL or alike, no slow connections over phone and such. The involved computers will also be rather modern (Dual Core Intel CPUs at 2GHz or more).

我知道如何处理机器上的音频。我不知道的是如何发送音频以有效的方式。

I know how to handle the audio on the machines. What I don't know is how to transmit the audio in an efficient way.

面临的挑战是:


  1. 我想获得跨线良好的音频质量。

  1. I'd like get good audio quality across the line.

流应该没有滴接收。流可能,但是,可以用一个小的延迟接收(第二延迟是可接受的)。我想象传输软件可以先确定平均(和最大)的延迟,然后开始流,并告诉接收者开始播放音频前等待最大延迟。同的是,如果延迟没有得到任何高,整个流将在另一侧可播放不口吃或滴剂

The stream should be received without drops. The stream may, however, be received with a little delay (a second delay is acceptable). I imagine that the transport software could first determine the average (and max) latency, then start the stream and tell the receiver to wait for that max latency before starting to play the audio. With that, if the latency doesn't get any higher, the entire stream will be playable on the other side without stutter or drops.

如果因意外IP延迟或堵塞,流的确实的中途被截断,我希望能够注意到这一点,这样我可以采取行动(如中止流)并最终启动一个新的传输。

If, due to unexpected IP latencies or blockages, the stream does get cut off, I want to be able to notice this so that I can take actions (e.g. abort the stream) and eventually start a new transmission.

我有哪些选择,如果我想不使用现成的软件,用于COM pression和tranmission?我不打算写我自己的声音融为一体pression引擎,真的。 OTOH,我计划解决方案销售的垂直市场,这意味着我可以负担得起的牌照费几元每本,但不是$ 100秒。

What are my options if I want do use ready-made software for the compression and tranmission? I have no intention to write my own audio compression engine, really. OTOH, I plan to sell the solution in a vertical market, meaning I can afford a few dollars of license fees per copy, but not $100s.

我想最简单的办法是只打开一个TCP流,送了几包来回,以确定其运行时间(甚至使用UDP的),然后使用结果作为指导对我的最大延迟值,然后简单地火音频数据以原始形式(uncom pressed 16位立体声),具有定时code在TCP连接一起。接收机读取数据和与该$ P $对确定延迟播放。这可能只是快速连接我期望的工作类型。

I guess the simplest solution would be to just open a TCP stream, send a few packets back and forth to determine their running time (or even use UDP for that), then use the results as the guide for my max latency value, then simply fire the audio data in its raw form (uncompressed 16 bit stereo), along with a timing code over the TCP connection. The receiver reads the data and plays it with the pre-determined delay. That might just work with the type of fast connection I expect.

我只是不知道是否有更好的解决方案,以实现这一目标,具有更好的性能(低延时)和较少的数据(COM pressed)。

I just wonder if there are better solutions to reach this goal, with better performance (lower latency) and less data (compressed).

顺便说一句,我第一次尝试实现这个在OS X,但可能会想这样做在Windows上也是如此,如果它证明是成功的。

BTW, I first try to implement this on OS X, but might want to do it on Windows, too, if it proves successful.

推荐答案

有关在互联网上你应该看看使用RTP传输音频。它是用于SIP,H.323,和许多其他使用该音频流的内容。你甚至可能想看看刚使用SIP lirbary。它已经拥有了很多东西,这听起来像你想要的。 SIP 可以有pretty质量​​好,如果你有一个好的codeC,并有足够带宽。

For transmitting audio over the Internet you should probably look at using RTP. It is used for SIP, H.323, and many others use this for streaming audio content. You might even want to look at just using a SIP lirbary. It already has much of what it sounds like you want. SIP can have pretty good quality if you have a good codec, and sufficient bandwidth.

  • http://tools.ietf.org/html/rfc3550
  • http://en.wikipedia.org/wiki/Real-time_Transport_Protocol

这篇关于如何流过互联网半直播音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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