Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Sound

Posted on 1998-09-05
6
Medium Priority
?
182 Views
Last Modified: 2010-04-06
Using both Delphi 1 and Delphi 2, I want to associate a sound to a click on a button.  I am stuck on my code, and since I never used sound before I am unfamiliar with that area.

Here is the scenario:
Sound file is called click.wav and is stored in directory f:/dmtb (the program directory)

I want to either use the wav file as part of my resources or have it load from file from the program directory.  THe sound would be played when certain buttons in the program are played.

My current code is in error.  What happens is the sound I have in the background will not clear so the wav file can be played.
0
Comment
Question by:DMM1956
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:Matvey
ID: 1338721
What do you mean "the sound I have in background"??? Of course you have to pause it. You could mix them, but that's hard.
0
 

Author Comment

by:DMM1956
ID: 1338722
If I have a sound like a Midi playing, the sound I associate with a button will not play.

Note:  the command I am looking for needs to be 16bit code (Delphi 1) as the client side of my DLL must be 16 bit.

Also trying to figure out how to include a wav file as part of the resources so I don't have to distribute the file with the program.

0
 
LVL 3

Expert Comment

by:Matvey
ID: 1338723
Midi shouldn't interfear. Another wav would though. How are you playing it?

See this:

http://bes.trendline.co.il/torry/vcl/buttons/spledbtn.zip
"...play Wav files or system sound when clicked"
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!

 
LVL 3

Expert Comment

by:Matvey
ID: 1338724
-See sndPlaySound in Win32s.HLP

c u
0
 
LVL 1

Accepted Solution

by:
duke_n earned 200 total points
ID: 1338725
HEY!
Use
sndplaysound('click.wav',snd_nodefault);//windows will wait the //sound to end and then give the "turn" back to your program
or
sndplaysound('click.wav',snd_async);//if you want to do //something while windows plays the sound
0
 

Author Comment

by:DMM1956
ID: 1338726
Ooops...slipped accepting the last.  Here is the problem.  SndPlaySnd I believe is 32 BIT.  I need 16bit code to play sound when I click a button within a program.  WIN32 code will not work with what I have in mind.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

804 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