在.NET中,如何访问音频输入流? [英] In .NET, how do I access an audio input stream?

查看:117
本文介绍了在.NET中,如何访问音频输入流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VB.NET,我想分析从Web广播电台获得的输入音频流(例如:).但是,我正在努力寻找合适的起点.

Using VB.NET, I want to analyze input audio streams obtained from Web radio stations (e.g.: "Flower Power Radio" via TuneIn). However, I am struggling in finding a suitable starting point.

很明显,当进入Web浏览器的Web地址(如上例所示)时,流开始流动并在这种情况下由所述Web浏览器解释.

Obviously, when entering into the Web browser a Web address (as given in above example), a stream starts flowing and is being interpreted by, in this case, said Web browser.

只有我计划的实验不涉及浏览器的要求;而且由于我不想重播接收到的音频流,也不想对其进行录制,因此我也可以放弃使用MediaPlayer.

Only that my planned experiments do not involve the requirement for a browser; and since I do not want to replay the received audio stream, nor record it, I can also abstain from using the MediaPlayer.

我只是"想要拦截流的有效载荷数据以便执行音乐信号的时频分析.但是,我如何访问此连续传送的数据?

I "just" want to intercept the stream's payload data in order to perform time–frequency analysis for music signals. But, how do I access this continuously delivered data?

(我可能应该补充一点,我并不真正接受使用任何类型的第三方库.)

( I should probably add, that I do not really embrace using 3rd party libraries of any sort.)

推荐答案

要拦截流的有效载荷数据,请使用浏览器的开发人员工具.按F12,转到网络"选项卡,然后选择全部".然后按F5刷新页面.

To intercept the stream's payload data use the browser's developer tools. Press F12, go to the Network tab and select 'All'. Then press F5 to refresh the page.

请注意作为流源的第一行条目.从那里,您可以检查来自此流的请求/响应 http://flower.serverhostingcenter.com:8433/;

Notice the first row entry which is the stream's source. From there you can check the request/responses from this stream http://flower.serverhostingcenter.com:8433/;

现在可以访问下载数据了:

Now to access the downloading data use:

Dim c As New WebClient()
        Dim responseData As Byte() = c.DownloadData("http://flower.serverhostingcenter.com:8433/;")

由于流媒体无止境,因此文件将继续下载.当您要停止分析并分析结果时,这取决于您.您也可以使用异步事件.

Since the streaming is endless, the file will keep downloading. It's up to you when you want to stop it and analyse the results. You can use Async events as well.

这篇关于在.NET中,如何访问音频输入流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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