Thread: One last question then sleep...

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    15

    One last question then sleep...

    Is it possible to play a .wav file in MSVC++? If not, I will make do with Beep(freq, dur).

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    5

    playing wavs in MVC++

    Hi, I have the solution for you. It took me a long time to figure this out too. First of all I know that this works in a win32 console app. but i don't know about any other kind of program.
    1) first go to Project/Setting/Link Tab
    2)in the Object/Library Modules: box add this winmm.lib at the end of that list and make sure to put a space between it and the last one.
    3)then hit ok
    Then to play a sound your program could look like the second example on
    this page

    Note: you don't have to write out the full path of the file you want to play if it's in the same folder as your program.

    also the parameter of SND_FILENAME can change depending on what you want your sound to do (ie. if you want it to not slowdown or mess up the flow of the program and repeat you would use SND_ASYNC|SND_LOOP instead). You can find out about the parameters at
    this site

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  4. Sleep is overrated...
    By Polymorphic OOP in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 01-24-2003, 12:40 PM
  5. sleep
    By ivandn in forum Linux Programming
    Replies: 7
    Last Post: 12-13-2001, 11:20 PM