Thanks again AlanC,
I have got a sample to do this from ...

'Public Function SelectMicrophone(DeviceID As Long, Optional sError As String) As Boolean
'    Dim rc As Long, Index As Long
'    On Error GoTo Exception
'        'Get WaveIn Destination Line ID
'        Let pmxl.cbStruct = Len(pmxl)
'        Let pmxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN
'        Let rc = mixerGetLineInfo(DeviceID, pmxl, MIXER_GETLINEINFOF_COMPONENTTYPE)
'        If rc <> 0 Then GoTo Exception 'Error Trap
'        'Get Control ID with MIXER
'        Let pmxlc.cbStruct = Len(pmxlc)
'        Let pmxlc.dwLineID = pmxl.dwLineID
'        Let pmxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MIXER
'        Let pmxlc.cControls = pmxl.cControls
'        Let pmxlc.cbmxctrl = Len(pmxc)
'        Let pmxlc.pamxctrl = VarPtr(pmxc)
'        Let rc = mixerGetLineControls(DeviceID, pmxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE)
'        If rc <> 0 Then
'            'Get Control ID
'            Let pmxlc.dwControl = MIXERCONTROL_CONTROLTYPE_MUX
'            Let rc = mixerGetLineControls(DeviceID, pmxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE)
'            If rc <> 0 Then GoTo Exception 'Error Trap
'        End If
'        'Get Control Details
'        ReDim mcdlt(pmxc.cMultipleItems - 1)
'        Let pmxcd.cbStruct = Len(pmxcd)
'        Let pmxcd.cChannels = 1
'        Let pmxcd.dwControlID = pmxc.dwControlID
'        Let pmxcd.item = pmxc.cMultipleItems
'        Let pmxcd.cbDetails = Len(mcdlt(0))
'        Let pmxcd.paDetails = VarPtr(mcdlt(0))
'        Let rc = mixerGetControlDetails(DeviceID, pmxcd, MIXER_GETCONTROLDETAILSF_LISTTEXT)
'        If rc <> 0 Then GoTo Exception 'Error Trap
'        For Index = LBound(mcdlt) To UBound(mcdlt)
'            pmxl.dwLineID = mcdlt(Index).dwParam1
'            Let rc = mixerGetLineInfo(DeviceID, pmxl, MIXER_GETLINEINFOF_LINEID)
'            If rc <> 0 Then GoTo Exception 'Error Trap
'            If pmxl.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE Then
'                Exit For
'            End If
'        Next
'        If Index > UBound(mcdlt) Then GoTo Exception
'        'Get Control Values
'        ReDim mcdb(pmxc.cMultipleItems - 1)
'        Let pmxcd.cbDetails = Len(mcdb(0))
'        Let pmxcd.paDetails = VarPtr(mcdb(0))
'        Let mcdb(Index) = 1
'        Let rc = mixerSetControlDetails(DeviceID, pmxcd, MIXER_SETCONTROLDETAILSF_VALUE)
'        If rc <> 0 Then GoTo Exception 'Error Trap
'    Let SelectMicrophone = True
'    Exit Function
'End Function

but when ever i execute this function, i get fatal error, while closing the main application.

I thing some memory free issue...
can u pls. help me?


Hi Soorya

This thread just lives on and on!

This is maybe possible but its difficult to do. I've been able to programmatically adjust the master volume but not much else. The fundamental issue is that there is a lot of variation between sound cards. To give you an idea of this, you can have a one-of-n selection switch for record source (e.g Soundblaster) or multiple selections (e.g. ESS chipsets); and the 'Stereo Mix' line you refer to can be called different things or may not exist at all.

Practically, the Win32 API allows you to enumerate the lines and controls in the recording mixer and you have then to make a decision about what you want to do. This will, I believe, be different from one card to another.

I've got a lot on at the moment but I'll have a look at some point.

I did make a start on my audio tutorial but this is a huge task too. I need to ask the moderators what I need to do to to post it up on DaniWeb- I'm sure it'd get loads of hits.

Best regards,


Does this thread live on? i could really need the double buffer version also... please could you send it to my e-mail westman@hot.ee would really apreciate it!!! thanx!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.