Solved

vb3 multichannel wav support

Posted on 1997-06-21
8
260 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Access Product Inventory Movement Transfer Form With Separate Records Combined Into one Form 55 91
vb6 connector to mongodb 2 120
Hide vba in gp 7 104
Spell Check in VB6 13 126
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

856 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