Click here to Skip to main content
16,021,430 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
For playing an MP3 file, I use this code in C#:
playCommand = "open \"" + textBox1.Text + "\" type mpegvideo alias MediaFile";
mciSendString(playCommand, null, 0, IntPtr.Zero);
playCommand = "play MediaFile";
mciSendString(playCommand, null, 0, IntPtr.Zero);


It works for all musics and videos and even images such as:
wav, wmv, jpg

But it works for no mp3 file!
All my mp3 files can be played by "Windows Media Player" but not by my C# winform application.

What should I do?
Posted

Have a look at this article:

MP3 Player for Windows 7[^]
 
Share this answer
 
Have a look at this:
Play MP3 Files Using C#[^]
 
Share this answer
 
Sandeep Mewara wrote:
Have a look at this:
Play MP3 Files Using C#[^]

Thanks Sandeep Mewara,
But it was the code that I used and did not work!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900