Solved

playing wavefiles simultaneusly

Posted on 1998-08-15
8
149 Views
Last Modified: 2010-04-30
How can I play a "click" wavefile without disturbing the music background?  
It is possible in VB?
0
Comment
Question by:afonso
  • 4
  • 2
  • 2
8 Comments
 
LVL 1

Expert Comment

by:BabyFace
ID: 1468939
Hi,
using the Microsoft MMControl you can open multiwave and
play them simultanously.
Ex:
MMControl1.DeviceType = "WaveAudio"
MMControl1.filename = App.Path + "\" + "wave1.wav"
MMControl1.Command = "Open"
MMControl1.Command = "Play"

MMControl1.filename = App.Path + "\" + "wave2.wav"
MMControl1.Command = "Open"
MMControl1.Command = "Play"

Hope this helps

0
 

Author Comment

by:afonso
ID: 1468940
Sorry, my friend, but it did't work
I'm using VB5 enterprise edition, and in the 'help' and in the manual, it is very clear that it's impossible to change the filename property of a MMControl with the device open. I tried, anyway, and it didn't work.
I tried too, with two MMControls, but the second control refuses to open the device.
I've heard about a WAVEMIX.DLL library, and downloaded it from the WEB,but it did'nt work. I seached the WEB for hours, trying to find a 32 bit version and could only find a name. "WAVMIX32.DLL", but not available for download or even sale.
I'm using a Sound Blaster AWE32 card, on a Pentium 200 MMX with 64 RAM, and trying do write a simple Multimidia program, with a wave music playing in the background (in a loop), and I would like to play a Click when any button is pressed without interfering the background music, as we can see in any simple computer game. But the task appears to be beyond my limited skills.

Thank you

Afonso
0
 
LVL 1

Expert Comment

by:BabyFace
ID: 1468941
Well it worked on my PC.

I used just one MMControl as you see from my peice of code.
Sorry.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:afonso
ID: 1468942
See the comments above.
0
 
LVL 3

Accepted Solution

by:
CesarGon earned 100 total points
ID: 1468943
Use the PlaySound API function.

Regards,
César.

0
 

Author Comment

by:afonso
ID: 1468944
Hi, César (something tells me that you speak portuguese or at least spanish)

It didn't work. The API PlaySound and sndPlaySound cannot play sounds simultaneously, no matter the flags you use. I checked in the Microsoft site, and in the support area I found an article that confirms it.

BUT I FOUND THE ANSWER. And the answer is......

DIRECT SOUND

But to learn how to write a code to play sounds using the DirectX technology don't appears to me being a easy task. So I purchased a special OCX custom control from TEGO corporation, that worked fine. Now my World-Cup-France-98 database program is soundig professionally.

Thank you, anyway

Afonso

0
 

Author Comment

by:afonso
ID: 1468945
Hi, César (something tells me that you speak portuguese or at least spanish)

It didn't work. The API PlaySound and sndPlaySound cannot play sounds simultaneously, no matter the flags you use. I checked in the Microsoft site, and in the support area I found an article that confirms it.

BUT I FOUND THE ANSWER. And the answer is......

DIRECT SOUND

But to learn how to write a code to play sounds using the DirectX technology don't appears to me being a easy task. So I purchased a special OCX custom control from TEGO corporation, that worked fine. Now my World-Cup-France-98 database program is soundig professionally.

Thank you, anyway

Afonso

0
 
LVL 3

Expert Comment

by:CesarGon
ID: 1468946
Hi Afonso. I speak Spanish and Galego, which is quite close to portuguese. Congratulations you have found the answer.

Regards,
César.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

828 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