Solved

How to create immediate sound from click

Posted on 1998-08-29
8
156 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
Comment Utility
API function Beep does it.
0
 

Author Comment

by:jinx1
Comment Utility
Adjusted points to 100
0
 

Author Comment

by:jinx1
Comment Utility
I'm trying to find a routine that doesn't use the internal speaker.
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
How about PlaySound() ???

Regards,
Viktor Ivanov
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

 
LVL 3

Accepted Solution

by:
a111a111a111 earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks a1  !
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…

728 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

9 Experts available now in Live!

Get 1:1 Help Now