Solved

Working with Beep

Posted on 2004-08-03
7
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

617 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