#include <iostream>
#include <windows.h>
using namespace std;
void main()
{
cout << "Playing synchronous sound..." << endl;
PlaySound("mysound.wav", NULL, SND_FILENAME | SND_SYNC);
Sleep(1500);
PlaySound("mysound2.wav", NULL, SND_FILENAME | SND_ASYNC);
cout << "playing asynchronous sound";
for(int i = 0; i < 50; i++)
{
cout<<".";
sleep(50);
}
cout<<endl;
}
It also included some other files. When I tried to do this in my file, cutting and pasting this stuff, I got all these errors saying "SND_FILENAME undeclared" and stuff.
So, is it possible for me to do this in my dos program?
Playsound?
Today, I downloaded a tutorial on putting sound in your file. The example was a dos window that played two sounds and then quit. Here is the code.
DOS? No. Win32 Console? Yes. Make sure to include mmsystem.h and link winmm.lib.
[Resist Windows XP''s Invasive Production Activation Technology!]
[Resist Windows XP''s Invasive Production Activation Technology!]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement