Sign in to follow this  
Followers 0
XmangiaX

Toggle "Mute" for Line in

7 posts in this topic

My co worker and I share speakers through our line in's. So if I want to listen to what hes playing I unmute my line-in. If I want to listen to my winamp I mute his line in. I was wondering if there is a way to toggle the little mute box with a handy little script.

Any ideas?

Thanks for any assistance given. :whistle:

Share this post


Link to post
Share on other sites



I have this piece of code:

; Get Wav Sound Volume
; Author gafrost

#include <GUIConstants.au3>

MsgBox(0,"", _SoundGetWaveVolume())

Func _SoundGetWaveVolume()
    Local $WaveVol = -1, $p, $ret
    Const $MMSYSERR_NOERROR = 0
    $p = DllStructCreate ("dword")
    If @error Then
        SetError(2)
        Return -2
    EndIf
    $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p))
    If ($ret[0] == $MMSYSERR_NOERROR) Then
        $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100)
    Else
        SetError(1)
    EndIf
    $Struct=0 
    Return $WaveVol
EndFunc;==>_SoundGetWaveVolume

It's for GET and not SET volume, so take it as way to go on...

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I will play with this code to see what I can come up with.

Thanks, but Im looking for a toggle for mute on "LINE IN" and not a volume level number. We each have our own volume controls. Is it possible to do what I want? :whistle:

Posted Image

Edited by XmangiaX

Share this post


Link to post
Share on other sites

I will play with this code to see what I can come up with.

Thanks, but Im looking for a toggle for mute on "LINE IN" and not a volume level number. We each have our own volume controls. Is it possible to do what I want? :whistle:

I know about LineIn WAV differrence.

My example was for you as start for searching.

WINMM.DLL has these functions:

CloseDriver DefDriverProc DriverCallback DrvGetModuleHandle GetDriverModuleHandle MigrateAllDrivers MigrateSoundEvents NotifyCallbackData OpenDriver PlaySound PlaySoundA PlaySoundW SendDriverMessage WOW32 DriverCallback WOW32ResolveMultiMediaHandle WOWAppExit WinmmLogoff WinmmLogon _gfxLogoff@0 _gfxLogon@4 aux32Message auxGetDevCapsA auxGetDevCapsW auxGetNumDevs auxGetVolume auxOutMessage auxSetVolume gfxA ddGfx gfxBatchChange gfxCreateGfxFactoriesList gfxCreateZoneFactoriesList gfxDestroyDeviceInterfaceList gfxEnumerateGfxs gfxModifyGfx gfxOpenGfx gfxRemoveGfx joy32Message joyConfigChanged joyGetDevCapsA joyGetDevCapsW joyGetNumDevs joyGetPos joyGetPosEx joyGetThreshold joyReleaseCapture joySetCapture joySetThreshold mci32Message mciDriverNotify mciDriverYield mciExecute mciFreeCommandResource mciGetCreatorTask mciGetDeviceIDA mciGetDeviceIDFromElementIDA mciGetDeviceIDFromElementIDW mciGetDeviceIDW mciGetDriverData mciGetErrorStringA mciGetErrorStringW mciGetYieldProc mciLoadCommandResource mciSendCommandA mciSendCommandW mciSendStringA mciSendStringW mciSetDriverData mciSetYieldProc mid32Message midiConnect midiDisconnect midiInAddBuffer midiInClose midiInGetDevCapsA midiInGetDevCapsW midiInGetErrorTextA midiInGetErrorTextW midiInGetID midiInGetNumDevs midiInMessage midiInOpen midiInPrepareHeader midiInReset midiInStart midiInStop midiInUnprepareHeader midiOutCacheDrumPatches midiOutCachePatches midiOutClose midiOutGetDevCapsA midiOutGetDevCapsW midiOutGetErrorTextA midiOutGetErrorTextW midiOutGetID midiOutGetNumDevs midiOutGetVolume midiOutLongMsg midiOutMessage midiOutOpen midiOutPrepareHeader midiOutReset midiOutSetVolume midiOutShortMsg midiOutUnprepareHeader midiStreamClose midiStreamOpen midiStreamOut midiStreamPause midiStreamPosition midiStreamProperty midiStreamRestart midiStreamStop mixerClose
 mixerGetControlDetailsA mixerGetControlDetailsW mixerGetDevCapsA mixerGetDevCapsW mixerGetID mixerGetLineControlsA mixerGetLineControlsW mixerGetLineInfoA mixerGetLineInfoW mixerGetNumDevs mixerMessage mixerOpen mixerSetControlDetails mmDrvInstall mmGetCurrentTask mmTaskBlock mmTaskCreate mmTaskSignal mmTaskYield mmioAdvance mmioAscend mmioClose mmioCreateChunk mmioDescend mmioFlush mmioGetInfo mmioInstallIOProcA mmioInstallIOProcW mmioOpenA mmioOpenW mmioRead mmioRenameA mmioRenameW mmioSeek mmioSendMessage mmioSetBuffer mmioSetInfo mmioStringToFOURCCA mmioStringToFOURCCW mmioWrite mmsystemGetVersion mod32Message mxd32Message sndPlaySoundA sndPlaySoundW tid32Message timeBeginPeriod timeEndPeriod timeGet
DevCaps timeGetSystemTime timeGetTime timeKillEvent timeSetEvent waveInAddBuffer waveInClose waveInGetDevCapsA waveInGetDevCapsW waveInGetErrorTextA waveInGetErrorTextW waveInGetID waveInGetNumDevs waveInGetPosition waveInMessage waveInOpen waveInPrepareHeader waveInReset waveInStart waveInStop waveInUnprepareHeader waveOutBreakLoop waveOutClose waveOutGetDevCapsA waveOutGetDevCapsW waveOutGetErrorTextA waveOutGetErrorTextW waveOutGetID waveOutGetNumDevs waveOutGetPitch waveOutGetPlaybackRate waveOutGetPosition waveOutGetVolume waveOutMessage waveOutOpen waveOutPause waveOutPrepareHeader waveOutReset waveOutRestart waveOutSetPitch waveOutSetPlaybackRate waveOutSetVolume waveOutUnprepareHeader waveOutWrite wid32Message winmmDbgOut winmmSetDebugLevel wod32Message
so you must start search MSDN and look for right one ...

Share this post


Link to post
Share on other sites

:whistle:

oh ok... ive been toying with this bit of code, but to no avail! Ill keep digging for answers. If anyone has anymore insight I would greatly appreciate it.

Thanks again!

Share this post


Link to post
Share on other sites

Im so stuck on this idea... :whistle:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0