Solved

Working with Beep

Posted on 2004-08-03
7
301 Views
Last Modified: 2010-05-02
Public Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long


I want to know how to output the beep through the pc speakers instead of the speaker inside the pc.
  Thanks a lot.
0
Comment
Question by:macaila
7 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11710355
You can use WinAPI's PlaySound() function.
0
 
LVL 1

Expert Comment

by:burnttime
ID: 11711322
You could just use...

Private Sub Form_Load()
Beep
End Sub

No need for the API
Therefore you dont need the code

Public Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

0
 
LVL 9

Expert Comment

by:s_sansanwal
ID: 11711980
Seems your System's default sound playback is set to PC rather than Speakers
Goto Control pannel -> Sound and Audio Devices -> Audio Tab -> change "default device" under "sound playback" to speakers
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:macaila
ID: 11712551
Private Sub Form_Load()
Beep
End Sub

that would be good if i could set the freqvency and the time but if i don't use api i can't,
the normal beep without the api is played on the pc speaker, but the beep with api is played on the speaker inside the computer,
I'm trying to play different freqvencyes to see what is my hearing range is.
0
 
LVL 7

Expert Comment

by:_agj_
ID: 11712881
maybe u shud use the directsound api.
0
 
LVL 7

Accepted Solution

by:
Burbble earned 77 total points
ID: 11714957
I knew this link would come in handy some day ;-)

http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=39362&lngWId=1

-Burbble
0
 
LVL 7

Expert Comment

by:Burbble
ID: 11804789
Thanks for the points, glad I could help.

-Burbble
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now