Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am working on an application, where i need to run an Dialog based application and at

the same time i need to play an Audio file at the Background simultaneously. Any Idea,

have views on how to implement it in my application using vc++ or c++.

Thanks in Advance.
Posted

C#
{
  if(m_PlayMusic) // start the music...
    ::PlaySound(MusicFileSpec.c_str(),NULL,SND_ASYNC|SND_LOOP|SND_FILENAME);
  else // stop the music...
    ::PlaySound(NULL,NULL,SND_ASYNC|SND_FILENAME);
}
 
Share this answer
 
one of the solutions is on the application start run worker thread worker thread[^]. and start playing there.
In such a deign you wont block the main dialogs. etc.
 
Share this answer
 
Comments
Kumar 09 31-Oct-12 5:32am    
while running audio files simultaneously can i add the (jpg, gif)image to static text control using worker thread. if possible how to do, if not possible any other solution
I'd use mmsystem and waveio but howabout..
C++
mciSendString("Open \"dingdong.wav\" alias audio") || mciSendString("play audio");
 
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