CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2005
    Posts
    13

    Playing wavesound or midi using MFC

    I'm creating a game application, may i know how to add in audio feature? ie when i click the start button, the background music will start to play, then when i click a bomb button, an explosion can be heard.

    i roughly look at the Media player activeX control, but it seems offering up a lot of classes and sounds complicated.

  2. #2
    Join Date
    Jun 2005
    Location
    Chennai , India
    Posts
    1,375

    Thumbs up Re: Playing wavesound or midi using MFC

    Check out these links....will be very helpful !!

    Audio & Video articles



    Multimedia


    Playing Midi files with DirectMusic


    if a link helps,dont forget to "Rate this post"
    It takes seconds for rating…that actually compensates the minutes taken for giving answers
    The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
    Regards, Be generous->Rate people
    Jayender!!

  3. #3
    Join Date
    Jul 2003
    Posts
    147

    Re: Playing wavesound or midi using MFC

    #include "mmsystem.h"

    BOOL PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);

    http://msdn.microsoft.com/library/de..._playsound.asp

  4. #4
    Join Date
    Jun 2005
    Posts
    13

    Re: Playing wavesound or midi using MFC

    PlaySound work for wave file and is able to loop as well.

    Right now i'm using a midi file, playing the file is not a problem, but i have no idea how to loop it using mciSendString. Can anyone help?

  5. #5
    Join Date
    Aug 2004
    Location
    Slovakia
    Posts
    135

    Re: Playing wavesound or midi using MFC

    So if you are making some serious things, then use some free libs...like

    http://www.openal.org/
    http://www.libsdl.org/index.php

    Trigve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured