hi,thanks for the reply but what im trying to do is add wav sound to the program based on below condition. If meet condition (pass) will play WAVE SOUND and if doesnt meet the condition (fail) below will play another wave sound. thought of auto call the Button4Click for fail and Button5Click for pass but not sure how to do it. any idea ?
sorry for the trouble n thanks for ur prompt reply.
{
MediaPlayer1->FileName = "error_alarm.wav";
MediaPlayer1->AutoRewind = true;
MediaPlayer1->Open(); // Open the media player
try
{
MediaPlayer1->Wait = true; // don’t return until playing is done
MediaPlayer1->Play(); // Play sound
// MediaPlayer1->Play(); // Play again after first play is completed
}
__finally
{
MediaPlayer1->Close(); // Close media player
}