好的,Silverlight 4 正在添加 支持从麦克风(和网络摄像头)捕获,但是为了使此功能有用(至少在我的情况下),我需要将捕获的数据上传到服务器以保存。
AudioCaptureDevice 将在客户端记录 PCM 音频,众所周知 PCM 不是最有效的编码...数据太大而无法上传未压缩的数据。
理想情况下,我可以在客户端上将此 PCM 流编码为 AAC,然后将该压缩流上传到服务器。
像这个库之类的东西可能有用。但它不支持 AAC。
(我选择 AAC 是因为(与 MP3 不同)它的编码是免版税的,并且受到流行的 PMP 设备的支持。)
对于实现这一目标的最佳方法有什么想法吗?所有选项都在桌面上:完全信任、Google Gears 等...
感谢您的帮助!
OK so Silverlight 4 is adding support for capturing from microphones (and webcams), however for this facility to be useful (in my case at least) I'd need to upload this captured data to a server to save.
The AudioCaptureDevice will record PCM audio on the client, and as we all know PCM is not the most efficient encoding... the data would be too large to upload uncompressed.
Ideally, I could encode this PCM stream to AAC right on the client, then upload that compressed stream to the server.
Something like this library, may be useful. However it doesn't support AAC.
(I'm choosing AAC because (unlike MP3) it is royalty-free to encode, and is supported by popular PMP devices.)
Any thoughts out there on the best way to accomplish this? All options are on the table: full-trust, Google Gears, etc...
Thanks for any help!
发布评论
评论(4)
有一种名为 Speex 的音频编解码器,Alden Torres 将 SPEEX 算法移植到了 C# 中。这样您就拥有了一个完全托管的音频编码器。这是相关的博客文章 他展示了如何使用 SPEEX 对麦克风中的音频进行编码。另请阅读评论。
There's an audio codec out there called Speex AND Alden Torres ported the SPEEX algorithm to C#. So you have a full managed audio encoder. Here's the relevant blog post where he shows how to encode the audio from the mic with SPEEX. Read also the comments.
正如上面提到的答案,Speex 是一种语音编解码器,如果您想将其用于音乐,则不太合适。
但是,如果您仍然对 Silverlight 上的 Speex 感兴趣,那么您应该看看 NSpeex,它是Speex 的早期版本到 C#,它还提供了一个 Silverlight 库。
As the answer mentioned above Speex is a voice codec which is not really appropriate if you want to use it for music.
However, if you are still interested in Speex on Silverlight than you should take a look at NSpeex which is a port of an earlier version of Speex to C# and it also offers a Silverlight library.
我需要在 Silverlight 中录制音乐(例如从线路输入)并将其保存在服务器上。它必须具有良好的质量(不像 SPEEX)。我将尝试在客户端上使用蹩脚的编码器。它需要可以通过 p-invoke 访问的 lame_enc.dll。我将测试是否可以从 silverlight 进行测试。
你知道一些替代方案吗?也许是一个好的流服务器(wowza 可以吗)?
I need to record a music in Silverlight (e.g. from the line-in) and save it on the server. It must be in a good quality (not like SPEEX). I will try to use a lame encoder on the client. It needs the lame_enc.dll that can be accessed by p-invoke. I will test if it is possible from the silverlight.
Do you know some alternatives? Maybe a good stream server (is it possible with wowza)?
您应该知道 AAC 编码也受到专利限制。查看维基百科关于它的文章。如果您想要免费格式,您应该考虑 Vorbis 或 FLAC(或 Speex)。
如果您使用的是 Windows 7 或 Server 2008 R2 机器,则可以使用 SDK 来编码 AAC (http://msdn.microsoft.com/en-us/library/dd742785(v=VS.85) .aspx)。
另外,既然你强迫客户端做大量的工作,为什么不在上传之前将其压缩——我不是 Silverlight 人员,所以也许这是不可能的?
You should know that AAC encoding is patent restricted as well. Check out the Wikipeadia article on it. If you want a free format, you should look into Vorbis or FLAC (or Speex).
If you're on a Windows 7 or Server 2008 R2 box, you might be able to use the SDK to encode AAC (http://msdn.microsoft.com/en-us/library/dd742785(v=VS.85).aspx).
Also, since you're forcing the client to do a bunch of work anyway, why not just zip it before you upload it -- I'm not a Silverlight person, so maybe that's not possible?