3

How can I make the motherboard internal speaker produce sounds, for example using the Beep command but directed towards the motherboards speakers.

OS = Windows 7 x64

I currently know how to provide beeps to the default sound device, including tone and millisecond's but this does not answer my question since I cant force any of these sounds towards the motherboard internal speakers.

Beep(523, 500);

My question is mainly based around an alternative to Beep which would play through the motherboards speakers rather than the computer audio card. Or a way to direct the Beep command or incoming audio frequencies towards the motherboards speakers.

ITCSB
  • 39
  • 1
  • 4
  • 3
    You can't expect us to give you code? – Arnav Borborah Aug 10 '16 at 20:38
  • 1
    Did you google that? It is unclear what you are asking here or/and too broad – Khalil Khalaf Aug 10 '16 at 20:40
  • FirstStep, I googled this, but received no real answer for Windows 7. – ITCSB Aug 10 '16 at 20:43
  • 1
    Define "_real answer_"? And did you start with any base code? – Khalil Khalaf Aug 10 '16 at 20:43
  • 2
    Using the Beep(hertz, milli) and trying /a in the console. Although that only directed it to my default sound device as I expected. – ITCSB Aug 10 '16 at 20:45
  • 1
    @FirstStep dude, what? How would it be possible to start with base code for something that is not known how to do? – zetavolt Aug 10 '16 at 20:49
  • 1
    @ZephyrPellerin wow calm down. OP could have improved the Q if wanted to get better responses. Why did not he provide that small code in the OP instead of the comment then? – Khalil Khalaf Aug 10 '16 at 20:52
  • @FirstStep could you inform me how to better improve the question in order for the community to provide better answers? I am quite new as you might be able to tell and would appreciate any feedback I can get. – ITCSB Aug 10 '16 at 20:53
  • This question seems reasonable scoped, hence I can't see why it needs a code attempt. However the community is full of homework question so they all expect some code, for example you could add that Beep... only send to default sound device (to make them less skeptic and show that you understand some of the issues. – Petter Friberg Aug 10 '16 at 20:55
  • @PetterFriberg I think I edited the question to be more descriptive. – ITCSB Aug 10 '16 at 20:59
  • Err...this may not be what your looking for, but like this? std::cout<<"\a"; EDIT: nevermind see you already tried that. – Futuza Aug 10 '16 at 21:08
  • @DarthFutuza no sorry, I just tested it and it only provides you with the Windows error / notification beep, not a motherboard beep or even a specified frequency, but thank you. – ITCSB Aug 10 '16 at 21:11
  • I have edited your post to send it in to re-open que, if you have more details consider to future improve your question. – Petter Friberg Aug 10 '16 at 21:18
  • @PetterFriberg I edited it a bit more but I couldn't find that much more to add, thanks for editing it yourself as well. – ITCSB Aug 10 '16 at 21:19
  • 1
    this question seems similar, maybe it can help you http://stackoverflow.com/questions/4060601/make-sounds-beep-with-c – Petter Friberg Aug 10 '16 at 21:29
  • @PetterFriberg I saw that one before making this question and it did not answer the question I had for Windows 7 OS. – ITCSB Aug 10 '16 at 21:31
  • 1
    Consider editing into the question, to avoid duplicate, explaining why it does not work – Petter Friberg Aug 10 '16 at 21:32
  • 1
    This may also be of interest http://superuser.com/questions/227939/how-to-make-the-pc-speaker-beep-from-the-windows-7-command-prompt, moving on I hope it gets re-opened – Petter Friberg Aug 10 '16 at 21:35
  • @PetterFriberg the reasons why these don't help is because they mainly pertain to making a real Beep through the sound card, and when they are specifically talking about the motherboard internal speakers, it requires you to replace windows operating system files, which I cannot do in this particular instance. – ITCSB Aug 10 '16 at 21:38
  • 1
    Lots of good stuff to explain in question : ), show research effort, explain all requirements etc. – Petter Friberg Aug 10 '16 at 21:41

2 Answers2

3

The question was later specified to refer to Win32 programming environment, this question describes a Linux solution.

You can use the KIOCSOUND ioctl to generate a tone, as such

ioctl(fd,KIOCSOUND,(int) tone)

The Linux Programming Interface is a fabulous book that describes using IOCTLs in detail, but there are public resources that describe the IOCTL such as the perennially classic TLDP.

zetavolt
  • 2,989
  • 1
  • 23
  • 33
  • I appreciate the response and it would be perfect although I am not running linux for my operating system, although ill keep that line of code in case I need it at a later time! – ITCSB Aug 10 '16 at 20:46
  • @ITCSB Next time consider tagging platform-sensitive questions with `[linux]` or `[windows]` etc. – Keith M Aug 10 '16 at 22:06
2

In Windows 7, Beep was rewritten to pass the beep to the default sound device for the session. This is normally the sound card, except when run under Terminal Services, in which case the beep is rendered on the client. source

There is apparently one possible modification of system descibed here.

Community
  • 1
  • 1
artursg
  • 66
  • 5
  • This seems great, but it wouldn't work for my needs, I am trying to create a song with beep commands and then give it to my friend who wouldn't want his computer system files being changed in any shape or form. – ITCSB Aug 10 '16 at 21:09