Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,

I am writing a program to play a wav file in C++ using mmsystem library(mmsystem.h),

I can play, stop and pause but I can not when end play wav file.

Please help em to resolve this.

Thanh you very much!
Posted

1 solution

Depends on the callback mechanism you have adopted in waveOutOpen() API.

1) If you choose to have a window or thread receive callback information, the following messages are sent to the window procedure function to indicate the progress of waveform-audio output: MM_WOM_OPEN, MM_WOM_CLOSE, and MM_WOM_DONE.
MM_WOM_DONE indicates the end of playback.

2) If you choose to have a function receive callback information, the following messages are sent to the function to indicate the progress of waveform-audio output: WOM_OPEN, WOM_CLOSE, and WOM_DONE.
WOM_DONE also indicates the end of playback.

References:
- WOM_DONE[^]
- MM_WOM_OPEN[^]
- MM_WOM_CLOSE[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900