Need help with sound( )
Hi,
This program I wrote the other day worked fine when I was tweaking it (Borland C++ 5.01), but now I''ve gone back to finish it up and it won''t build. I''m not sure what''s wrong.
#include <stdio.h>
#include <dos.h>
#include <conio.h>
void soundtest(void); //prototype
void main(void)
{
printf("Press a key to begin.");
printf("\nPress a key to end");
getch();
soundtest();
}
void soundtest(void)
{
int s;
for(s=0;s<500;s++)
{
sound(s);
delay(100);
if(kbhit())
{
printf("\n\nExcellent!");
break;
}
}
}
I get the the following errors:
Error: Unresolved external ''_sound'' referenced from module soundtest.c
Error: Unresolved external ''_delay'' referenced from module soundtest.c
One more problem, when the program was working, the sound would only work the first time the program was run, and subsequent tries would result in not getting any sound, and I''d have to reboot the computer for it to work again. Does the PC Speaker have a buffer that needs to cleared each time I start the program or something?
Thanks
well, is sound() an object? and if so, why don''t you include "sound.h" or something like that? and the same goes for delay().
or are they part of a library? and if they are, did you include that library in your project.
as far as why it only works once, that could be a lot of different things. it depends what you are using to make the sound. Sounds like something isn''t being released that should be.
or are they part of a library? and if they are, did you include that library in your project.
as far as why it only works once, that could be a lot of different things. it depends what you are using to make the sound. Sounds like something isn''t being released that should be.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement