Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 WinAPI Beep through external speakers
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Phazor




PostPosted: Fri May 09, 2008 7:23 pm   Post subject: WinAPI Beep through external speakers

hey guys, im tryin 2 figure out if there is a way to make the beep function come out of the external speakers, cuz the winapi beep function comes out of the internal pc speaker. im using the winapi beep as opposed to the built in beep function because i want to be able to choose the frequency and duration. im pretty sure that it can be done cuz my computer at work beep through speakers, but it was a laptop, i dunno if thats y, since the speakers are built into the system. plz help

in case u were wondering, this is the code i used for declaring the function:
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Sponsor
Sponsor
Sponsor
sponsor
btiffin




PostPosted: Sat May 10, 2008 3:24 am   Post subject: Re: WinAPI Beep through external speakers

You may want to look into the PlaySound library routines in winmm.dll. A little bit more work, as you may either have to link to an external .wav resource or generate the wav on the fly. Or, user32.dll has MessageBeep that already links to the stock windows wav resources (type code of 0, 16, 32, 48, 64) or -1 for the same as VB beep (internal speaker beep, no control over freq and dur). I don't remember the other sound routines but there are others.

Or, use GNU/Linux and then write a soundcard driver and a kernel interface and an open source VB clone and a ... (kidding).

Cheers
Phazor




PostPosted: Sat May 10, 2008 12:38 pm   Post subject: Re: WinAPI Beep through external speakers

could u tell me how to generate .wav on the fly, iv never heard of doin that before
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: