Solved

vb3 multichannel wav support

Posted on 1997-06-21
8
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses
Course of the Month5 days, 13 hours left to enroll

626 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