Solved

vb3 multichannel wav support

Posted on 1997-06-21
8
255 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
Comment Utility
It can be done by mixing the two wav files yourself and then playing the resulting file.
0
 
LVL 2

Author Comment

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

Accepted Solution

by:
lmarceau earned 50 total points
Comment Utility
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
 
LVL 2

Author Comment

by:ChrisK
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 2

Author Comment

by:ChrisK
Comment Utility
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
Comment Utility
Sure, look for the WaveOut familly of function.


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

Author Comment

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

Expert Comment

by:lmarceau
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now