CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Exclamation How to add sound or music in MFC application

    How to add sound or music in MFC application?

    On some eventi want to play some bombing sound?

    Say wav files
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  2. #2
    Join Date
    Jan 2003
    Posts
    41

    playsound api

    in the msdn, look for playsound function

  3. #3
    Join Date
    Jun 2003
    Location
    Tbilisi, Georgia
    Posts
    36
    include in your project winmm.lib and

    try {
    !sndPlaySound("fileName")
    }
    catch (...)
    {}

  4. #4
    Join Date
    Aug 1999
    Location
    Wisconsin
    Posts
    507
    sndPlaySound() may be phased out. Use PlaySound instead.
    If you already have the waveform in memory, then look
    at the waveOutWrite() function (and the whole series
    of related waveOut.. functions.

  5. #5
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Any Code help

    Hello can any body give a 2-3 line code help. How to use
    Playsound function.

    i am facing problem with HANDLE

    I want to play a wave file added to recource
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  6. #6
    Join Date
    Jul 2003
    Posts
    147
    Add winmm.lib to the Linker->Input->Additional Dependencies like Vato said. Then,

    #include "mmsystem.h"

    ::PlaySound("alarm.wav",0,SND_ASYNC);

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