Solved

How to create immediate sound from click

Posted on 1998-08-29
8
160 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to debug this code 7 65
MS SQL store procedure to calculate and return result 6 74
Excel Automation VBA 19 115
VBA Replace Function - What am I missing? 3 50
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…
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…
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…

739 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