Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sir i try;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {            
            SoundPlayer sa = new SoundPlayer();            
            sa.Play(@"C:\Users\TRAX\Documents\MEMORYCARD\OhAyatai1.wav");            
        }
    }
}


however music does not play. Help me to correct this code.
Posted
Updated 2-Sep-11 17:45pm
v3
Comments
Dr.Walt Fair, PE 2-Sep-11 23:46pm    
Fixed code formatting.

1 solution

Try the following :
System.Media.SoundPlayer sp = new System.Media.SoundPlayer(@"C:\Users\TRAX\Documents\MEMORYCARD\OhAyatai1.wav");
sp.Play();
 
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