Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Playing a wave or mp3 file in my program

Playing a wave or mp3 file in my program

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mavrock
    wrote on last edited by
    #1

    I am making a little program that recieves ascii commands from the serial port. I want to make the program play an audio file when it recieves a specific string. Does anyone know how to just play an audio file in the background without pulling up windows media player? Thank you very much. Mavrock

    M A M 3 Replies Last reply
    0
    • M Mavrock

      I am making a little program that recieves ascii commands from the serial port. I want to make the program play an audio file when it recieves a specific string. Does anyone know how to just play an audio file in the background without pulling up windows media player? Thank you very much. Mavrock

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      http://www.codeproject.com/audio/mp3player.asp[^] Mazy **"If I go crazy then will you still Call me Superman If I’m alive and well, will you be There holding my hand I’ll keep you by my side with My superhuman might Kryptonite"**Kryptonite-3 Doors Down

      1 Reply Last reply
      0
      • M Mavrock

        I am making a little program that recieves ascii commands from the serial port. I want to make the program play an audio file when it recieves a specific string. Does anyone know how to just play an audio file in the background without pulling up windows media player? Thank you very much. Mavrock

        A Offline
        A Offline
        anju
        wrote on last edited by
        #3

        u can try with "mciSendString" API function ... anju

        1 Reply Last reply
        0
        • M Mavrock

          I am making a little program that recieves ascii commands from the serial port. I want to make the program play an audio file when it recieves a specific string. Does anyone know how to just play an audio file in the background without pulling up windows media player? Thank you very much. Mavrock

          M Offline
          M Offline
          mynab
          wrote on last edited by
          #4

          This should do: HWND hWnd = MCIWndCreate(GetSafeHwnd(), AfxGetInstanceHandle(), MCIWNDF_NOMENU | MCIWNDF_NOPLAYBAR | MCIWNDF_NOERRORDLG | MCIWNDF_NOOPEN, szFilename); MCIWndPlay(hWnd); To stop playing: MCIWndStop(hWnd); MCIWndDestroy(hWnd);

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups