| | |
audio level detection
![]() |
http://www.daniweb.com/tutorials/forum68.html, there should be a button on the bottom for contribute tutorial (the link is for VB Specifically).
•
•
Join Date: Dec 2005
Posts: 7
Reputation:
Solved Threads: 0
Thanks again AlanC,
I have got a sample to do this from ...
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?
soorya
I have got a sample to do this from ...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
'Public Function SelectMicrophone(DeviceID As Long, Optional sError As String) As Boolean ' Dim pmxl As MIXERLINE, pmxlc As MIXERLINECONTROLS, pmxc As MIXERCONTROL, pmxcd As MIXERCONTROLDETAILS, mcdlt() As MIXERCONTROLDETAILS_LISTTEXT, mcdb() As Long ' 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 'Exception: '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?
soorya
•
•
•
•
Originally Posted by AlanC
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,
AlanC
Last edited by Comatose; Feb 22nd, 2006 at 2:34 pm. Reason: Code Tags
•
•
Join Date: Jun 2006
Posts: 1
Reputation:
Solved Threads: 0
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!!
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Sort a dynamic array of structs
- Next Thread: build help system...
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





