如何在silverlight中压缩语音流
我已经使用 silverligh4 录制了音频并尝试通过服务器上的服务保存它。 问题是记录的 .WAV 文件有数十万字节的数据作为流。但是,当该流传递给服务时,其最大传输长度仅为 1526 字节。我已经在 web.config 中设置了 max 属性。我认为我们需要在客户端对流进行编码,然后传递此编码流并在服务器上对其进行解码。如何在silverlight上对音频流进行编码 应用程序并在服务器上对其进行解码?请给我建议。感谢您抽出时间。 Nspeex 或 CSpeex 不适合我。如果有人实施了相同的操作,请建议如何做?
I have recorded audio using silverligh4 and trying to save it through service on the server.
The problem is recorded .WAV file has lakhs ofbytes of data as stream. But when this stream is passed to service its getting transmitted as 1526 bytes max only. I have set max properties in web.config. I think we need to encode the stream on the client and pass this encoded stream and decode it on the server. How to encode the audio stream on sileverlight
application and decode it on the server? Please advice me. Thanks for your time. Nspeex or CSpeex do not work for me. If any one has implemented the same please suggest how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将 WAV 压缩到任何合理大小(无交易质量)的唯一方法是将其转换为另一种格式。
我不知道这是否适合您,但在发送到服务器之前使用 lame.exe 转换为 MP3 会非常容易。当然,您需要确保许可允许您随应用程序一起分发。
这是一个将 MP3 转换为 WAV 的开源程序:
http://www.codeproject.com/KB/audio-video/madlldlib.aspx
像这样转换为 MP3,您也许还可以使用 --decompress 选项将 MP3 转换为 WAV。
The only way to compress WAV to any reasonable size (without trading quality) is to convert it to another format.
I don't know if this is an option for you but it would be very easy to use lame.exe to convert to MP3 before sending to the server. Of course you'd need to make sure that licensing allows you to distribute with your application.
Here is an open source program to convert MP3 to WAV:
http://www.codeproject.com/KB/audio-video/madlldlib.aspx
Something like this to convert to MP3, you might be able to convert MP3 to WAV with lame also using the --decompress option.
我可能只是获取原始音频流,以低速率对其进行采样,然后通过压缩流将其发送出去。如果您想变得更奇特,您可以将压缩外包给像 LAME 这样的 MP3 编码器(在单独的线程/进程中!)。
I'd probably just take the raw audio stream, sample it at a low rate, and send it out via a compressed stream. If you wanted to get fancy, you could farm the compression out to an MP3 encoder like LAME (in a separate thread/process!).