How to Play WAV file in C++ Visual Studio 2010 ?

Code with C | Programming: Projects & Source Codes Forums C and C++ How to Play WAV file in C++ Visual Studio 2010 ?

This topic contains 1 reply, has 1 voice, and was last updated by  Adelaid 2 years, 5 months ago.

  • Author
    Posts
  • #11060

    HeatherKort
    Member

    I am using Visual Studio 2010

    I am trying to play wav files in C++ and i cannot get that to work
    trying to stick with the playsound() function that’s already built in

    the closest I’ve gotten is having the program ding at me
    so i know it can’t locate the file

    I have the wav file where my cpp file is

    I dunno how to get it to play

  • #11061

    Adelaid
    Member

    Make a P1.cpp file as shown in SoundTestForm; also make a main.cpp file.Write the codes shown. Call the .cpp file as P1.cpp(see it is included in the main.cpp codes)
    Make wav file of any music file and store it in a drive.Put the correct path in the
    form that shows on running this code. Press play.Bingo,there goes your sound track.
    The only disadvantage here is wav file is ten times larger that mp3 file.

    This is ok for experimentation.For practicality you should find a way to convert mp3 to wav
    in this program itself,so that conversion is done as it plays.
    regards and blessings

You must be logged in to reply to this topic.