Results 1 to 2 of 2

Thread: [RESOLVED] Trying to play wav

  1. #1

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    814

    Resolved [RESOLVED] Trying to play wav

    Hi i am makeing a little alarm clock and want to add a wav sound I done the code below but there is no sound when i use the code the wave file is also in the correct place any idea what i am doing wrong thanks.

    Code:
                string sFile = Path.Combine(Application.StartupPath, "attention.wav");
    
                if (File.Exists(sFile))
                {
                    System.Media.SoundPlayer sp = new SoundPlayer();
                    sp.SoundLocation = sFile;
                    sp.Play();
                }

  2. #2

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    814

    Re: Trying to play wav

    Ok guys i fixed it I had to chnage the bitrate to to 16 bit stero seems to play ok now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width