Discussion Locked

Volume Control in VB3

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I know, I know!! VB 3 is a little out of date, but most of our systems are still Win 3.11 based and we need to support them!!

Here's my problem. In the good old days, most soundcards sat on the ISA bus and with a simple 16 bit dll, it was possible to directly read and write port addresses to read or set volume levels for CD Audio, Line In ,Mic and Master Volume. Using for example, ioc.dll which allows IO reads and writes to hardware i/o space, a set of values could be written to s SB 16 cardto directly set mixer levels, without having to use the mixer application supplied by Creative. Under Windows 95 or 98, our app still worked using a SB card in an isa slot. Now we have to port the apps to newer machines with PCI soundcards, or worse, mobo's with AC97 sound controllers integrated into the Southbridge (e.g. SIS 7018). There is an API (MMSYSTEM.DLL in Win3.11/WinMM.DLL in 9x) but this is mostly concerned with wave, midi etc and I can't seem to find an API call for accessing mastervolume. Specifically, I want to access volume controls and mute/select functions from VB3 on any soundcard. Suggestions please?!! A VBX control would be preferable, but a 16 bit dll (documented if possible) to do the job would help. Yes I know....I really should port my apps to VB6 or VB.Net but I don't have the resources and like I say, most of my apps still have to work on 16 bit platforms (dinosaurs!!)

Help!!!!

6 replies

by guruofdos

Please don't refer me to MSDN or Microsoft knowledgebase!! I have trawled extensively and downloaded all their documents but none have the data I need. Microsoft stopped supporting VB3 years ago and most of their employees haven't even heard of Windows for Workgroups!!!!

by nikki96

I have never used VB3 (I use VB6 and .NET), so if I'm way off, forgive me.
Is there any reason you can't write an ActiveX control or COM object that controls the volume and use the control in VB3? They have those already written around the 'net. You can Google for several different kinds.

by guruofdos

ActiveX and COM are post VB3....VB3 is only 16 bit. 32 bit Windows versions do not allow direct reading and writing to hardware registers so I need to use a Win16 API call. There is plenty of data around for C++ and the mmsystem.h declarations. Thisdata includes structures and types for mixer functions. I need this info in VB format (declarations and function calls in a code module). The mmsystem.txt file supplied with VB3 only has part of the data. I have seen other examples for VB but they are for VB5 and higher!!

by guruofdos

Got a message saying "Sorry, web page is not available".

Anyway....I found a link to an archive with the same topic, but the information is exactly as the title suggests...controlling volume of a "sound file", i.e. a windows .wav . We don't use MIDI or wav files. What we DO use is several line inputs to a soundcard (VCR, DV Camera, CDAUDIO etc) and we need to adjust the mixer controls programmatically from within VB. Right-clicking the taskbar volume icon to bring up the SNDVOL32.exe programis NOT an option, because the software scans IO ports to respond to external devices like buttons and switches, movement detectors etc, then has to instantly mute a particular input line. Yes, this is an 'interacting with the real world in real time' app and not some fancy desktop applet!!!

This discussion is closed to new replies.