How to Stream a MP3 file using C#

Hi there

Does anyone have any code in C# that will stream a MP3 file based on a filelocation I give it?

also it must be a asp.net app
thanks
mousemat24Asked:
Who is Participating?
 
nbkbar7Commented:
Also here's an link to some usable code using NAudio an open source sound lib

http://stackoverflow.com/questions/184683/play-audio-from-a-stream-using-c-sharp
NAudio (open source) http://naudio.codeplex.com/
0
 
nbkbar7Commented:

Not Tested but something like this should work...

[DllImport("aygshell.dll", SetLastError = true)]
private static extern IntPtr SndPlaySync(string pszSoundFile, uint
dwFlags);

You can then use it as follows

SndPlaySync(@"\path\to\my\sound.mp3", 0);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.