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. MCI playback ended

MCI playback ended

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 2 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
    MikeRWinter
    wrote on last edited by
    #1

    Hi All! I am trying to playback a '.wav' file, which I have no problem with doing using the MCI. What I need to do is know when playback has finished. I have now spent a day looking in to this and not found anything anywhere - please help!!! Is using MCI the best way of doing this - I only wish to play, stop and pause sound files (mp3, wav and spx), nothing too clever, but detecting the end of the soundfile has proven to be a problem. I am using VC6 & Windows XP Any help and advice would be greatly appreciated! Regards Mike

    M C 2 Replies Last reply
    0
    • M MikeRWinter

      Hi All! I am trying to playback a '.wav' file, which I have no problem with doing using the MCI. What I need to do is know when playback has finished. I have now spent a day looking in to this and not found anything anywhere - please help!!! Is using MCI the best way of doing this - I only wish to play, stop and pause sound files (mp3, wav and spx), nothing too clever, but detecting the end of the soundfile has proven to be a problem. I am using VC6 & Windows XP Any help and advice would be greatly appreciated! Regards Mike

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

      Right I have had some success, but still need a bit of advice! I have overridden WindowProc, and when the wav file starts and stops, I recieve message 1224. I can then check the wParam and lParam to see the value. lParam is 525 when the wav file finishes playing. Does anyone know what is the definition of message 1224, and what are returned in wparam \ lparam? Thanks for any advice on this Regards Mike

      1 Reply Last reply
      0
      • M MikeRWinter

        Hi All! I am trying to playback a '.wav' file, which I have no problem with doing using the MCI. What I need to do is know when playback has finished. I have now spent a day looking in to this and not found anything anywhere - please help!!! Is using MCI the best way of doing this - I only wish to play, stop and pause sound files (mp3, wav and spx), nothing too clever, but detecting the end of the soundfile has proven to be a problem. I am using VC6 & Windows XP Any help and advice would be greatly appreciated! Regards Mike

        C Offline
        C Offline
        Cool_Dev
        wrote on last edited by
        #3

        Can't you use 'status' command string with mciSendString function() to get duration and current stream position? You may use a while loop to wait till both becomes equal. see a sample here http://www.daniweb.com/code/snippet268167.html

        M 1 Reply Last reply
        0
        • C Cool_Dev

          Can't you use 'status' command string with mciSendString function() to get duration and current stream position? You may use a while loop to wait till both becomes equal. see a sample here http://www.daniweb.com/code/snippet268167.html

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

          Thanks for helping Cool_Dev I did think about doing this in a similar manner - setting a 1 second timer running and checking to see the position of playback to see if the end of file had been reached. It did strike me as being a bit in-elligent. I was hoping for there to be a 'MCI_NOTIFY_PLAYBACK_FINISHED' type of message that I would need to capture. I don't know if you have seen my reply to my own post - I have had some success in getting a message, but I just have the value - it would be nice to know its definition. Thanks for lookingg and your advice Mike

          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