Solved

How to create immediate sound from click

Posted on 1998-08-29
8
158 Views
Last Modified: 2010-04-30
I am learning VB5 and am trying to create a "Simon" like game, for practice.  Can anyone help me with a routine that can produce immediate sound from a click ?  I would need to control pitch and duration. I am, unfortunately, working w/ a 486/66.  Any and all help is greatly appreciated.
0
Comment
Question by:jinx1
8 Comments
 

Expert Comment

by:topol
ID: 1431814
API function Beep does it.
0
 

Author Comment

by:jinx1
ID: 1431815
Adjusted points to 100
0
 

Author Comment

by:jinx1
ID: 1431816
I'm trying to find a routine that doesn't use the internal speaker.
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 10

Expert Comment

by:viktornet
ID: 1431817
How about PlaySound() ???

Regards,
Viktor Ivanov
0
 
LVL 3

Accepted Solution

by:
a111a111a111 earned 100 total points
ID: 1431818
I found a program that have a Vb source code to play immediate sound.

There take only the lines that you need for your "Simon" like game
Also you can find a nice procedures in the same code.

http://www.geocities.com/SiliconValley/Way/5233/vb1.htm
Download Multimedia Player(58kb) + source.

If you are not able to get the code email to shay@hili.com and I'll email it to you.

0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1431819
Hi,
Here is one more way to havre sound.
use wav files with voices clicks squicks and so.

and here is a very simple code to run it.

'=========== start ========

Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub Command1_Click()
Dim SndPlay
SndPlay = sndPlaySound("c:\hello.wav", 1)
End Sub

'======== end =========
0
 
LVL 3

Expert Comment

by:a111a111a111
ID: 1431820
Hi again.
If you need some wav files....
here are some links to great wav files...

1. http://www.allwavs.com/
2. http://www.wav.com/
3. http://home1.pacific.net.sg/~yms/wav.htm

if you need more let me know..



0
 

Author Comment

by:jinx1
ID: 1431821
Thanks a1  !
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

791 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