简体   繁体   English

如何在.NET中录制在线广播?

[英]How can I record online radio in .NET?

I did see this question but not much on .NET... 我确实看到了这个问题,但在.NET上并没有太多...

I want to write .NET code to connect to a web server streaming SHOUTcast (Winamp) audio content (if anyone is interested, the URL is http://live.radiotrinitas.ro:8000/ ) and record it. 我想编写.NET代码来连接到流媒体SHOUTcast(Winamp)音频内容的Web服务器(如果有人有兴趣,URL是http://live.radiotrinitas.ro:8000/ )并记录它。

But I don't know much how to do it . 但我不知道怎么做

Just open the HTTP connection, and stream it off to a file on the disk? 只需打开HTTP连接,然后将其流式传输到磁盘上的文件中?

There are some headers that appear to be in the content (or so it seems to me) and I don't know what the format is so how to name the extension of the file (MP3?) 有一些标题似乎在内容中(或者在我看来),我不知道格式是什么,所以如何命名文件的扩展名(MP3?)


Update1 : Update1:

I did try to connect using HttpWebRequest but it throws up saying ProtocolViolation. 我确实尝试使用HttpWebRequest进行连接,但它却抛出了ProtocolViolation。 Then I tried connecting using TcpClient and it doesn't send back anything. 然后我尝试使用TcpClient连接,它不会发回任何东西。 I guess it awaits some starting command. 我猜它等待一些启动命令。 I don't know this, apparently proprietary (?), protocol... 我不知道这个,显然是专有的(?),协议......

Well it seems someone over CodeProject posted something useful and working! 好吧,似乎有人在CodeProject上发布了一些有用且有效的东西!

http://www.codeproject.com/KB/audio-video/SHOUTcastRipper.aspx http://www.codeproject.com/KB/audio-video/SHOUTcastRipper.aspx

To run the code snippet you need to set the following configuration : 要运行代码段,您需要设置以下配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.net>
    <settings>
      <httpWebRequest useUnsafeHeaderParsing="true"/>
    </settings>
  </system.net>
</configuration>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用.net中的.net库构建MS Word文件的在线文字处理器? - How can i build an Online word Processor using .net.. Libraries in .net for MS word files? 如何使用Rest API v2 with .NET将销售收据添加到QuickBooks Online中 - How can I add a sales receipt using the Rest API v2 with .NET into QuickBooks Online 如何基于选择ListView记录选择合适的组合框值? -C#.NET - How Can I Choose Appropriate ComboBox Value Based on Select ListView Record? - C#.NET 在Asp.net C#代码中删除之前,如何在JavaScript弹出窗口中添加记录名称 - How can I add record name in a JavaScript popup before deletion in Asp.net C# code 如何将数据列表c#asp.net中的每个记录导出到单独的excelsheet - How can I export each record from datalist c# asp.net to separate excelsheet 如何在.NET单选按钮中获取DoubleClick事件? - How do I get a DoubleClick event in a .NET radio button? 我可以停止.Net BindingSource自动导航到新记录吗? - Can I stop a .Net BindingSource automatically navigating to a new record? 如何检查网络上的计算机是否在线? - How can I check if a computer on my network is online? 在哪里可以开始使用VB.NET中游戏的基本在线功能? - Where can I get started with basic online functionality for a game in VB.NET? 如何刷新链接到VB.NET中另一个用户已更改的MS Access记录的DataRow? - How can I refresh a DataRow linked to a MS Access record that has been changed by another user in VB.NET?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM