Solved

How to create immediate sound from click

Posted on 1998-08-29
8
161 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
[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
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
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

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

690 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