Thread: Question on sound in a game of mine

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    25

    Question on sound in a game of mine

    I am using the PlaySound function to play a .wav file of an explosion within a Battleship game I made for class. The problem I am having is that a section of code will not run until the .wav file is done playing. I am trying to call the PlaySound function to play the .wav file while a for loop displays a flashing HIT or MISS message. But the loop won't start until after the sound has played. Is there anyway I can play the sound while the loop is executing. I am using MSVS .Net C++.

    Thanks,
    Van

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    Have you tried PlaySound(file,SND_ASYNC)?
    Don't you dare hit me on the head, you know I'm not normal.
    A Stooge Site
    Green Frog Software

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    25
    Just what I needed, thank you soo much. I guess if I would have read the MSDN section on PlaySound a little mroe closely I would have caught that. I cut and pasted a call to PLaySound that had SND_SYNC in it

    Van

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 12:48 AM
  2. Sound Driver Programming Question
    By phos2k in forum Linux Programming
    Replies: 1
    Last Post: 11-10-2003, 11:07 PM
  3. Question on sound in a game of mine.
    By Vanished in forum C++ Programming
    Replies: 4
    Last Post: 12-09-2002, 05:46 PM
  4. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM
  5. Question about a game
    By TheGr8one in forum Game Programming
    Replies: 1
    Last Post: 09-15-2001, 10:44 PM