Aug 29, 2009 at 12:23 PM
Edited Aug 31, 2009 at 8:18 AM
Hi, I noticed in the NAudio Demo from the latest version of NAudio that if Filename is empty, then it opens a fileopendialog.
So if I paste a http link in that window and click OK, I've noticed that the FileName string looks something like this:
"C:\\Users\\User\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files\\Content.IE5\\2FO1NTK2\\20s.mp3"
How does this exactly happen? I don't want an OpenFileDialog because the path I want to play is already stated elsewhere.
And in my case, I use a string which looks something like this "http://domainname.com/file.mp3"
This creates an error stating that URL is not supported. So I guess there's something I'm missing here?
Edit: I'm thinking, there must be some code somewhere which actually starts a download stream or something? Since the Filename string path ends up in Temporary Internet Files?
I've tried stepping into the code and I can't see anything of what's happening "behind" the OpenFileDialog.
Can I alter the code somewhat to make it do just that?
Edit: I found the PlayMp3FromUrl code on StackOverflow. But the thing is, I get an error stating that "WaveOut" doesn't take the number of arguments.
Has there been any changes to the WaveOut.cs since PlayMp3FromUrl was written?
This is the line which fails:
"using (WaveOut waveOut = new WaveOut(0, 500, null))"
If I remove all arguments so is says "new WaveOut())" the code compiles and I can hear the first microsecond of the mp3 file. But it freezes after that, which is probably because of the lack of arguments I guess? I think atleast that the "500"
means latency settings.