Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I have added a video and an mp3 file to a folder created by me in the solution explorer. I have set the build action property to embedded resource and i would like to play the file using the windows media player in C# at run time. I can see the file but can not be played. Can anyone help me?
Posted
Comments
rajivpande86 8-Mar-11 18:37pm    
Can you put some sample of your code? It will ease the job of tracing your problem

1 solution

we can play audio file please use the following code
C#
private void buttonPlay_Click(object sender, EventArgs e)
       {

           System.Media.SoundPlayer sp = new System.Media.SoundPlayer(@"textBoxAudioFiles.Text");
           //sp.PlayLooping();
           //sp.Play();

       }
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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