Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Puter dont beep

Ask ALL your questions here

Puter dont beep

Postby tsimpson on Mon Oct 19, 2009 6:49 am

I have to create a programme that asks the end user to enter values for frequency and duration. The program should then issue a beep were the frequency and duration of the beep corresponde to the values entered by the user.

Now before I can do that I need to know if my puter is not working or is it my programming that is not.

I had to do a program that beeped when run but my puter dont beep, I'm in trouble see (sorry).

this is it below, it does run but as i said no beeps. please can someone help me.

/* Beep Application
Make simple sounds via beep (frequecy_hrs, duration_ms)
<theophilus Simpson>
<9-july-2009> */

#include <iostream> //Input Output header for cout
#include <windows.h> //Windows header for beep

using namespace std;

int main()
{
cout << "beep at 440 Hz for 500mS \n"; //Display Message
Beep(440,500); //440 hertz (A4) for half a secound
cout << "Beep at 494 Hz for 500mS \n";
Beep(494,500);
cout << "Beep at 523 Hz for 500mS \n";
Beep(523,500);
cout << "sure you get the jist by now \n";
Beep(587,500);
cout << "mix it up a little bit biatch \n";
Beep(659,500);


return 0;

}
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: Puter dont beep

Postby tsimpson on Mon Oct 19, 2009 6:55 am

Also I dont know if this helps but I'm using studio vis 2008 and i forgot to add

cin.get ();
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: Puter dont beep

Postby noobgrammer on Mon Oct 19, 2009 7:18 am

I know windows xp 64bit and I believe Vista 64 don't beep but windows 7 64bit will through the actual speakers and not the tower speaker
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Puter dont beep

Postby tsimpson on Mon Oct 19, 2009 7:33 am

well i am using vista 64. that is pants if i cant tell if the program will work or not.
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: Puter dont beep

Postby ThePainLingers on Mon Oct 19, 2009 9:05 am

Compile it to an exe, and send it to some one you know?
ThePainLingers
 
Posts: 8
Joined: Sat Oct 17, 2009 11:04 pm

Re: Puter dont beep

Postby ReiKo on Mon Oct 19, 2009 3:47 pm

Yes, I had same issue but funny thing is - Beep works on Windows 7 x64.

Please, read this topic of mine:

post2591.html?hilit=%20beep#p2591

I also posted on MSDN forums: http://social.msdn.microsoft.com/Forums ... bce09e9eb4

But no help from there either.
User avatar
ReiKo
 
Posts: 115
Joined: Sat May 09, 2009 5:11 pm

Re: Puter dont beep

Postby tsimpson on Tue Oct 20, 2009 9:28 am

I just follwed these instructions from this site http://www.vista4beginners.com/Disable-System-Beep and guess what? I have no beep at all. :(
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: Puter dont beep

Postby ReiKo on Fri Oct 23, 2009 7:15 am

tsimpson wrote:I just follwed these instructions from this site http://www.vista4beginners.com/Disable-System-Beep and guess what? I have no beep at all. :(



Heh, I don't even have that device installed :(
User avatar
ReiKo
 
Posts: 115
Joined: Sat May 09, 2009 5:11 pm

Re: Puter dont beep

Postby noobgrammer on Fri Oct 23, 2009 8:40 am

Ya if you have Windows XP/Vista 64bit they just didn't even support it

Windows Vista x64 and Windows XP 64-Bit Edition: This function is not supported.


that is straight from their site MSDN Beep Function
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Puter dont beep

Postby Vevix on Sat Oct 24, 2009 5:08 am

Yeah, If XP + Vista x64 don't come with Beep.sys then there isn't much you can do.

Not sure if you guys understand Usermode/Kernelmode (Ring3, Ring0) yet but it works like this.

Beep() -> NtDeviceIoControlFile() (On "\\Devices\\Beep") -> HalMakeBeep().

Basically without the driver you really can't do much. Gonna have to play sound someway else.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup
User avatar
Vevix
 
Posts: 142
Joined: Sat Oct 10, 2009 9:24 pm
Location: kernel32.dll


Return to QA

Who is online

Users browsing this forum: No registered users and 0 guests

cron