Silverlight的音频输出 [英] Audio output from Silverlight

查看:228
本文介绍了Silverlight的音频输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找开发Silverlight应用程序将需要的数据从Web服务器流(而不是音频流这样)。

I'm looking to develop a Silverlight application which will take a stream of data (not an audio stream as such) from a web server.

数据流随后将被操纵以给予一定格式的音频(G.711 A律例如),这将随后被转换成PCM以便可以应用附加的效果(如升压的体积)。

The data stream would then be manipulated to give audio of a certain format (G.711 a-Law for example) which would then be converted into PCM so that additional effects can be applied (such as boosting the volume).

我确定了这一点。我有我的数据,转换的G.711成PCM但我的问题是能够输出该PCM音频声卡。

I'm OK up to this point. I've got my data, converted the G.711 into PCM but my problem is being able to output this PCM audio to the sound card.

我基础上的解决方案一些针对.Net应用程序,但在Si​​lverlight中的C#代码有一个与试图采取委托(函数指针)的副本,这将是一个单独的问题的话题一旦我制作了一个简单的代码示例有问题。

I basing a solution on some C# code intended for a .Net application but in Silverlight there is a problem with trying to take a copy of a delegate (function pointer) which will be the topic of a separate question once I've produced a simple code sample.

所以,问题是......我怎么能输出,我已经在一个数据结构(目前数组)在我的Silverlight举行给用户的PCM音频? (请不要说写字节值到文本框)

So, the question is... How can I output the PCM audio that I have held in a data structure (currently an array) in my Silverlight to the user? (Please don't say write the byte values to a text box)

如果它是一个MP3或WMA文件,我会使用MediaElement的发挥,但我不想拥有,使之变成一个文件,因为这将提上应用动态效果的音频压接。

If it were a MP3 or WMA file I would play it using a MediaElement but I don't want to have to make it into a file as this would put a crimp on applying dynamic effects to the audio.

我见过的人说,低水平的几个职位音频支持差/不存在在Si​​lverlight所以我欢迎任何建议/意见的人可能有。

I've seen a few posts from people saying low level audio support is poor/non-existant in Silverlight so I'm open to any suggestions/ideas people may have.

推荐答案

的简单的答案是,有用于PCM播放Silverlight的所以,除非你想写一个完全托管的PCM MP3转换器你被卡住不支持在第2版。即使是这样,我不知道你能得到MediaElement的,从独立存储玩。

The simple answer is that there is no support for PCM playback from Silverlight in version 2. So unless you want to write a fully managed PCM to MP3 converter you are stuck. Even then I'm not sure you could get the MediaElement to play from isolated storage.

是否有任何机会,你可以使用Web服务来执行转换

Is there any chance you could use a web service to perform the conversion?

也看到这个问题?
http://stackoverflow.com/questions/347288/wheres-the-sound-api-in-silverlight-or-how-do-i-write-a-music-app-to-磨合-T

更新: Silverlight 3的支持自定义音频源。但是,它不会让你拦截样本对WMA或MP3执行效果,想必对于DRM的原因,所以你仍然将可能需要编写自己的解码器。

Update: Silverlight 3 supports your custom audio sources. However, it won't let you intercept samples to perform effects on WMA or MP3, presumably for DRM reasons, so you would still potentially need to write your own decoder.

这篇关于Silverlight的音频输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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