如何在C#中播放和录制流媒体广播# [英] How Can I Play And Record A Stream Radio In C#

查看:111
本文介绍了如何在C#中播放和录制流媒体广播#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Code项目中找到了一个源代码,它可以逐字节读取流并提取元数据并将其记录到mp3文件中!这是链接: SHOUTcast Stream Ripper [ ^ ]

如何在录制时播放流相同的源代码

非常感谢您的帮助!!

I have found a source code in Code project that can read a stream byte by byte and extract metadata and record it into an mp3 file ! here is the link : SHOUTcast Stream Ripper[^]
How can i play a stream while recording using the same source code
thanks so much for your help !!

推荐答案

查看单个代码文件的第130-138行:

Look at lines 130-138 of the single code file:
if (count++ < metaInt) // write bytes to filestream
{
  if (byteOut != null) // as long as we don't have a songtitle, we don't open a new file and don't write any bytes
  {
    byteOut.Write(buffer, i, 1);
    if (count%100 == 0)
      byteOut.Flush();
  }
}



在我的印象中,这看起来就像你获得mp3数据的位置( byte [] buffer )。现在用编解码器解压缩缓冲区,并将结果数据发送到声卡。


In my impression, this looks like the position where you get the mp3 data (in byte[] buffer). Now de-compress the buffer with the codec, and send the resulting data to the sound card.


这篇关于如何在C#中播放和录制流媒体广播#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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