Jump to content

  • Log In with Google      Sign In   
  • Create Account

Playsound?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 IRDumb   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 October 2001 - 09:15 AM

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.
  
#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?

Sponsor:

#2 IRDumb   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 October 2001 - 09:18 AM

Wow, it messed that up pretty good. Those spacing errors are not mine.

#3 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 11 October 2001 - 11:40 AM

DOS? No. Win32 Console? Yes. Make sure to include mmsystem.h and link winmm.lib.

[Resist Windows XP''s Invasive Production Activation Technology!]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS