Solved

vb3 multichannel wav support

Posted on 1997-06-21
8
263 Views
Last Modified: 2006-11-17
I need to know if it's possible, and if so how can I play at least 2 wavs as the same time using VB3 standard 16-bit code/API calls?  If I can at least get 2 wavs to play at the same time I will be happy...  I know it can be done with other languages...but how bout in this case?  Please provide code if possible...
0
Comment
Question by:ChrisK
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:y96andha
ID: 1427526
It can be done by mixing the two wav files yourself and then playing the resulting file.
0
 
LVL 2

Author Comment

by:ChrisK
ID: 1427527
That would defeat the purpose...and take up way too much hd space.
0
 
LVL 1

Accepted Solution

by:
lmarceau earned 50 total points
ID: 1427528
You can mix the two file yourself in memory in small chunks or look for Microsoft's WaveMix.dll which does it for you.
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 2

Author Comment

by:ChrisK
ID: 1427529
I'm gonna look for this dll, but if I don't find it, how would I mix 2 wavs in memory in vb3????  Is there some API calls or something that do it? (I DO NOT have MCI.VBX)
0
 
LVL 2

Author Comment

by:ChrisK
ID: 1427530
I'm gonna look for this dll, but if I don't find it, how would I mix 2 wavs in memory in vb3????  Is there some API calls or something that do it? (I DO NOT have MCI.VBX)
0
 
LVL 1

Expert Comment

by:lmarceau
ID: 1427531
Sure, look for the WaveOut familly of function.


(ps: Attend very short answer for 15pt)
0
 
LVL 2

Author Comment

by:ChrisK
ID: 1427532
ok, give me 100% working VB 3 16-bit code and 55 points are yours.
0
 
LVL 1

Expert Comment

by:lmarceau
ID: 1427533
Check for sound card driver with
  waveOutGetNumDevs
Get the capabilities of them all with
  waveOutGetDevCaps
If there is more than one ask the user which he wants to use
Open the selected devices at the selected format with
  waveOutOpen

Mix and write the data to memory using arrays

Prepare the data for playback with
  waveOutPrepareHeader
Send it to the device with
  waveOutWrite
Send another just after, it will be put in the queue.

In a loop with a DoEvents, Check for the WHDR_DONE flag in the WAVEHDR structure of the first buffer. This will in dicate that the first buffer has finished its playback.
At this time, you will clear the first array and use it to place and prepare a third data block and send it to the device.
Continue like this until all data had been played.

Allways check for error, if anything appends :
  waveOutGetErrorText
and show this error to the user and ask him want to do next

When you are done :
   waveOutClose

If you need the Windows 3.1 Multimedia reference, give me your email and I will send it to you. It is a 340k windows help file.

Tell me if you can't make it work. But tell me if you succeed too !

            --- Guim
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

679 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