Thread: Play something...

  1. #1
    Foo
    Guest

    Play something...

    Ok, i have MSVC++ 6.0, and i was wondering if there was any way to add to my program a sound file. And then when they open my program, it plays in the background. Now ive searched for 6 days now and i can't find any explanation. They have mis-understood my question, or i have written a non-understandable one.
    They think that i want my program to play a file that is on that persons machine, but what i really want is to add it to my program (like adding .bmp's) and playing it IN my program.

    - Foo

  2. #2
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    one word: "huh?"

  3. #3
    Registered User (TNT)'s Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    339

    Lol..

    Ya so...

    I guess you would wanna use a custom resource to add your sound file, then load it up and play it. The playing it from resource script i cannot remember....
    TNT
    You Can Stop Me, But You Cant Stop Us All

  4. #4
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    As (TNT) stated you can import a wav resource, by right clicking on your resources folder. To then play it you can do -

    PlaySound(MAKEINTRESOURCE(IDR_WAVE1), 0,SND_RESOURCE );

    where IDR_WAVE1 is your resource identifier. You'll have to include the multi media header and library.
    zen

  5. #5
    Registered User
    Join Date
    Nov 2001
    Posts
    2
    Thats just what i needed :P
    Thanks
    Last edited by Sh0cky; 11-18-2001 at 04:43 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to play play and stop wav files
    By cnu_sree in forum Linux Programming
    Replies: 4
    Last Post: 08-14-2006, 11:11 PM
  2. pls post here tricks that you know of in C/C++, thanks
    By mickey in forum C++ Programming
    Replies: 55
    Last Post: 06-12-2003, 04:28 PM
  3. Gui Class With Tic Tac Toe
    By xxYukoxx in forum C++ Programming
    Replies: 1
    Last Post: 06-01-2003, 04:28 PM
  4. Cribbage Game
    By PJYelton in forum Game Programming
    Replies: 14
    Last Post: 04-07-2003, 10:00 AM
  5. Nibbles (DirectX) play my first completed game's Upgrade!
    By Jeremy G in forum Game Programming
    Replies: 3
    Last Post: 01-25-2003, 07:37 PM