如何在.NET 2.0(c#/ vb.net)中从其他服务器播放mp3文件?

时间:2021-01-18 14:02:16

I want to create a window application which will play an mp3 file, which will be on a different server.

我想创建一个窗口应用程序,它将播放一个mp3文件,该文件将位于不同的服务器上。

For an example,

举个例子,

I have a URL (http://songs.mastemag.com/indian-movie-songs/L/download.php?get=2cdeb5bfb354f297e97ba6b6b3b53203&file=1/love-aaj-kal/01%20~%20Twist%20(MastiMag.com).mp3). I want to play this file from window application on my local machine without downloading this file.(with the help of streaming)

我有一个URL(http://songs.mastemag.com/indian-movie-songs/L/download.php?get=2cdeb5bfb354f297e97ba6b6b3b53203&file=1/love-aaj-kal/01%20~%20Twist%20(MastiMag。 COM).MP3)。我想从本地机器上的窗口应用程序播放此文件而不下载此文件。(在流式传输的帮助下)

I have code that is using 'winmm.dll' and plays local mp3 file. Is there a way in which I can use this dll to play this kind of file.

我有使用'winmm.dll'的代码并播放本地mp3文件。有没有办法可以使用这个DLL来播放这种文件。

You can also suggest me any other approach as well.

你也可以建议我任何其他方法。

2 个解决方案

#1


Take a look at NAudio

看看NAudio

#2


The simple way will be to use the Window Media Player Control (in hidden mode).
It can work with http urls and local (file) urls.

简单的方法是使用Window Media Player Control(隐藏模式)。它可以使用http网址和本地(文件)网址。

Howto: use it with .NET

Howto:与.NET一起使用

#1


Take a look at NAudio

看看NAudio

#2


The simple way will be to use the Window Media Player Control (in hidden mode).
It can work with http urls and local (file) urls.

简单的方法是使用Window Media Player Control(隐藏模式)。它可以使用http网址和本地(文件)网址。

Howto: use it with .NET

Howto:与.NET一起使用