Talk2Tom11 Posted February 23, 2004 Posted February 23, 2004 this is my code: System.Diagnostics.Process.Start("wmplayer.exe", "Help Me.mp3") it opens Windows Media Player, but the song doesn;t start. I haver the song located in the Bin Folder. Any One Know how to get the song to play? Quote
Talk2Tom11 Posted February 23, 2004 Author Posted February 23, 2004 When I used this code with WMP 8 in the computer it worked... but didn't work with WMP 9. It opens media player but does not play the song. Any ideas please help. Quote
Leaders Iceplug Posted February 24, 2004 Leaders Posted February 24, 2004 You have to supply the whole path to file... it won't look in the Bin folder for the file. And then, you have to make sure that the path doesn't have any spaces. (filenames with ~#) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Talk2Tom11 Posted February 24, 2004 Author Posted February 24, 2004 It does read from the bin file by default. That is where you have it read text files from, etc. Also this code worked with WMP 8. It just isn't working wit WMP 9. Quote
Leaders Iceplug Posted February 25, 2004 Leaders Posted February 25, 2004 What I'm saying is that, when you pass the filename into it like that, the Windows Media Player is going to receive just the filename: "Help Me.mp3"... and it will try to run it... but WMP is running from some other distant folder on the computer (Program Files\Windows Media Player) and when it sees that filename, it probably won't have a clue as to where that file is, unless (maybe) you have it already in your Windows Media Player Library... and I think WMP is smart enough to know where the file is since it has already found it before. But, that's just a guess... :-\ you may want to look at the [api]GetShortPathName[/api] API, and Environment.CurrentDirectory to get a path name for your song. :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
darknuke Posted February 26, 2004 Posted February 26, 2004 System.Diagnostics.Process.Start("wmplayer.exe", System.Environment.CurrentDirectory & "Help Me.mp3") :) Quote This is only a test of the emergency broadcast system This is a product of hysterical mass confusion A ship of fools adrift on the sea of our pollution Rudderless and powerless on the sea of our delusion pennywise - this is only a test
Talk2Tom11 Posted February 29, 2004 Author Posted February 29, 2004 I tried the past post, It opened WMP but gave me an error... and didn't play the file. Didn't even recognize the file. Quote
Leaders Iceplug Posted March 1, 2004 Leaders Posted March 1, 2004 That's because WMP9 is treating the spaces that occur in your filename to be separating the arguments. Try making the path to your file like this. System.Diagnostics.Process.Start("wmplayer.exe", "C:\docume~1\talk2t~1\mydocu~1\visual~1\etc~1\HelpMe~1.mp3") :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.