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