Play Sound in a game..

This is a discussion on Play Sound in a game.. within the Game Programming forums, part of the General Programming Boards category; hi, i'm making the game battleship..and i have used the playsound function to include .wav files in my program... for ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    42

    Play Sound in a game..

    hi,

    i'm making the game battleship..and i have used the playsound function to include .wav files in my program...

    for example...an explosion when a ship is hit, etc.

    BUT i wanted to know how to use this function to have say a song play the entire duration of the program. I assume theres a way and it would just loop the song over and over again correct?

    If someone can help me w/ this it would be great!

    i use windows XP, and microsoft.net console applications in C++.

    THANKS!

    BBNERD

  2. #2
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078
    I would have given a proper response, but you cross-posted. Don't do it next time

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    42
    i'm sorry won't happen again
    i realized after i did it that the post would be better for gaming board...SORRY!

    BBNERD

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Vanished just asked this question a couple days ago.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    42
    i know this, i'm friends w/ vanished...my question is a little different..maybe i didnt' explain it enough..

    i want to have say a song play throughout the whole program..and loop over and over. The problem is, there are other sounds that may interrupt this original sound.

    What i need to know is if there is a way to still loop that song over and over and also have other sounds occur during that same time slot?

    HELP!

    BBNERD

  6. #6
    Registered User
    Join Date
    Aug 2001
    Posts
    380
    Whats wrong with
    play_sound(file,SND_SYNC) and
    play_sound(songfile,SND_LOOP | SND_ASYNC)? The only problem with that I know is that play_sound only play .wav files.
    Don't you dare hit me on the head, you know I'm not normal.
    A Stooge Site
    Green Frog Software

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Could you post how you're using PlaySound(); ???
    You should be able to play a sound without intterupting
    the other sound(s)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-26-2006, 12:14 AM
  2. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 08:41 PM
  3. Low latency sound effects
    By VirtualAce in forum Game Programming
    Replies: 0
    Last Post: 12-21-2004, 01:58 AM
  4. Game structure, any thoughts?
    By Vorok in forum Game Programming
    Replies: 2
    Last Post: 06-07-2003, 02:47 PM
  5. Lets Play Money Making Game
    By ggs in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-04-2001, 09:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21