Solved

SB16 (not AWE32) Mixer Control

Posted on 1999-01-12
8
365 Views
Last Modified: 2010-05-18
I want to use my IR port to receive data from my VCR remote and control my soundcard volume.  Receiving the data is the easy part, but...

I need to know how to control the Sound Blaster 16 mixer (master, line, CD levels, bass/treble, etc.) through the Win95 drivers.  Plenty of DOS info out there, but there's not much on Win95.  Please include lots of detail - I have limited experience in VB programming.  Thank-you!
0
Comment
Question by:kevinna
  • 4
  • 3
8 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1455883
The routines you need are from the Multimedia library. You should look in the Windows API for mixerGetLineInfo(), mixerGetControlDetails and mixerSetControlDetails().
0
 

Author Comment

by:kevinna
ID: 1455884
Sorry, I looked at the Win API info and this didn't help a whole lot.  For 600 pts, can anyone provide some code ?

eg. where you would:
-open the mixer
-identify the chanel [CD, line, master, bass, treb, etc]
-query its status
-set the channel to a new value
-close the mixer

Again, I have [very] limited VB experience.  I'm develping this in school (not an assignment, just a hobby project) on VB 5, BTW.
0
 

Author Comment

by:kevinna
ID: 1455885
Sorry, I looked at the Win API info and this didn't help a whole lot.  For 600 pts, can anyone provide some code ?

eg. where you would:
-open the mixer
-identify the chanel [CD, line, master, bass, treb, etc]
-query its status
-set the channel to a new value
-close the mixer

Again, I have [very] limited VB experience.  I'm develping this in school (not an assignment, just a hobby project) on VB 5, BTW.
0
 
LVL 7

Expert Comment

by:Dedushka
ID: 1455886
Hi, kevinna!

Here information from Visual Studio MSDN disk:
----------------------
Audio Mixer Functions
The following functions are used with audio mixers:
mixerClose  
mixerGetControlDetails  
mixerGetDevCaps  
mixerGetID  
mixerGetLineControls  
mixerGetLineInfo  
mixerGetNumDevs  
mixerMessage  
mixerOpen  
mixerSetControlDetails

mixerOpen
The mixerOpen function opens a specified mixer device and ensures that the device will not be removed until the application closes the handle.

MMRESULT mixerOpen(
  LPHMIXER phmx,    
  UINT uMxId,        
  DWORD dwCallback,  
  DWORD dwInstance,  
  DWORD fdwOpen      
);
 
Parameters
phmx
Address of a variable that will receive a handle identifying the opened mixer device. Use this handle to identify the device when calling other audio mixer functions. This parameter cannot be NULL.
uMxId
Identifier of the mixer device to open. Use a valid device identifier or any HMIXEROBJ (see the mixerGetID function for a description of mixer object handles). A "mapper" for audio mixer devices does not currently exist, so a mixer device identifier of – 1 is not valid.
dwCallback
Handle of a window called when the state of an audio line and/or control associated with the device being opened is changed. Specify zero for this parameter if no callback mechanism is to be used.
dwInstance
User instance data passed to the callback function. This parameter is not used with window callback functions.
fdwOpen
Flags for opening the device. The following values are defined:
CALLBACK_WINDOW
The dwCallback parameter is assumed to be a window handle.
MIXER_OBJECTF_AUX
The uMxId parameter is an auxiliary device identifier in the range of zero to one less than the number of devices returned by the auxGetNumDevs function.
MIXER_OBJECTF_HMIDIIN
The uMxId parameter is the handle of a MIDI input device. This handle must have been returned by the midiInOpen function.
MIXER_OBJECTF_HMIDIOUT
The uMxId parameter is the handle of a MIDI output device. This handle must have been returned by the midiOutOpen function.
MIXER_OBJECTF_HMIXER
The uMxId parameter is a mixer device handle returned by the mixerOpen function. This flag is optional.
MIXER_OBJECTF_HWAVEIN
The uMxId parameter is a waveform-audio input handle returned by the waveInOpen function.
MIXER_OBJECTF_HWAVEOUT
The uMxId parameter is a waveform-audio output handle returned by the waveOutOpen function.
MIXER_OBJECTF_MIDIIN
The uMxId parameter is the identifier of a MIDI input device. This identifier must be in the range of zero to one less than the number of devices returned by the midiInGetNumDevs function.
MIXER_OBJECTF_MIDIOUT
The uMxId parameter is the identifier of a MIDI output device. This identifier must be in the range of zero to one less than the number of devices returned by the midiOutGetNumDevs function.
MIXER_OBJECTF_MIXER
The uMxId parameter is a mixer device identifier in the range of zero to one less than the number of devices returned by the mixerGetNumDevs function. This flag is optional.
MIXER_OBJECTF_WAVEIN
The uMxId parameter is the identifier of a waveform-audio input device in the range of zero to one less than the number of devices returned by the waveInGetNumDevs function.
MIXER_OBJECTF_WAVEOUT
The uMxId parameter is the identifier of a waveform-audio output device in the range of zero to one less than the number of devices returned by the waveOutGetNumDevs function.
Return Values
Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:

Value Description
MMSYSERR_ALLOCATED The specified resource is already allocated by the maximum number of clients possible.
MMSYSERR_BADDEVICEID The uMxId parameter specifies an invalid device identifier.
MMSYSERR_INVALFLAG One or more flags are invalid.
MMSYSERR_INVALHANDLE The uMxId parameter specifies an invalid handle.
MMSYSERR_INVALPARAM One or more parameters are invalid.
MMSYSERR_NODRIVER No mixer device is available for the object specified by uMxId. Note that the location referenced by uMxId will also contain the value – 1.
MMSYSERR_NOMEM Unable to allocate resources.


Remarks
Use the mixerGetNumDevs function to determine the number of audio mixer devices present in the system. The device identifier specified by uMxId varies from zero to one less than the number of devices present.

If a window is chosen to receive callback information, the MM_MIXM_LINE_CHANGE and MM_MIXM_CONTROL_CHANGE messages are sent to the window procedure function to indicate when an audio line or control state changes. For both messages, the wParam parameter is the handle of the mixer device. The lParam parameter is the line identifier for MM_MIXM_LINE_CHANGE or the control identifier for MM_MIXM_CONTROL_CHANGE that changed state.

To query for audio mixer support or a media device, use the mixerGetID function.

QuickInfo
  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mmsystem.h.
  Import Library: Use winmm.lib.

See Also
Audio Mixers Overview, Audio Mixer Functions, mixerGetID, auxGetNumDevs, midiInOpen, midiOutOpen, waveInOpen, waveOutOpen, midiInGetNumDevs, midiOutGetNumDevs, mixerGetNumDevs, waveInGetNumDevs, waveOutGetNumDevs, MM_MIXM_LINE_CHANGE, MM_MIXM_CONTROL_CHANGE

Is this an information you looking for?
If "yes", let me know, i'll copy other functions description and send you.

Best Regards,
Dedushka

0
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.

 

Author Comment

by:kevinna
ID: 1455887
Looks like we're on the right track now :-)  I would greatly appreciate it if you could send out the other descriptions.

Is there any example code provided in addition to the function descriptions as shown above? (if yes, and you send these as well, I'll add another 100 pts.)
0
 
LVL 7

Accepted Solution

by:
Dedushka earned 700 total points
ID: 1455888
Hi, kevinna!

You see the size of previous message, may be it will be better to send the function's descriptions by e-mail, then post here?

I am waiting for your answer and prepare file with descriptions.

Regards,
Dedushka.
0
 

Author Comment

by:kevinna
ID: 1455889
Sounds good - please send what you have to kevin@techplus.com
0
 
LVL 7

Expert Comment

by:Dedushka
ID: 1455890
kevinna,
thank you for accepting my answer.
I just now sent MS Word file for you with full set of Mixer functions.

Best regards,
Dedushka
0

Featured Post

What Security Threats Are You Missing?

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

746 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

14 Experts available now in Live!

Get 1:1 Help Now