1

Тема: AHK: Свой gui микшер

Чисто в цели набраться опыта хочу узнать как сделать свой микшер на подобии системного?
Прочитал SoundSet и SoundGet , научился изменять только общую громкость. А как же добиться соотношения громкостей разных программ?

2

Re: AHK: Свой gui микшер

; Requirements:
;   VA 2.1 - http://www.autohotkey.com/forum/topic23792.html
;   Windows 7
;   AutoHotkey_L
;   Luck?

IID_IAudioSessionManager2 := "{77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F}"
IID_ISimpleAudioVolume := "{87CE5498-68D6-44E5-9215-6DA47EF883D8}"

dev := VA_GetDevice()
if !dev
    throw "Can't get device"
if VA_IMMDevice_Activate(dev, IID_IAudioSessionManager2, 7, 0, mgr) != 0
    throw "Can't get session manager"
ObjRelease(dev)
if VA_IAudioSessionManager2_GetSessionEnumerator(mgr, enm) != 0
    throw "Can't get session enumerator"
ObjRelease(mgr)
VA_IAudioSessionEnumerator_GetCount(enm, count)
Loop % count
{
    ; IAudioSessionControl *session;
    VA_IAudioSessionEnumerator_GetSession(enm, A_Index-1, ssn)
    VA_IAudioSessionControl_GetDisplayName(ssn, name)
    VA_IAudioSessionControl2_GetProcessId(ssn, pid)
    sav := ComObjQuery(ssn, IID_ISimpleAudioVolume)
    ObjRelease(ssn)
    if !sav ; Unlikely?
        throw "Can't get volume control"
    VA_ISimpleAudioVolume_GetMasterVolume(sav, volume)
    MsgBox %name%`nPID: %pid%`nVolume: %volume%
    ObjRelease(sav)
}
ObjRelease(enm)


;
; ISimpleAudioVolume -- currently not included in VA.ahk
;
VA_ISimpleAudioVolume_SetMasterVolume(this, Level, EventContext) {
    return DllCall(NumGet(NumGet(this+0)+3*A_PtrSize), "uint", this, "float", Level, "uint", VA_GUID(EventContext))
}
VA_ISimpleAudioVolume_GetMasterVolume(this, ByRef Level) {
    return DllCall(NumGet(NumGet(this+0)+4*A_PtrSize), "uint", this, "float*", Level)
}
VA_ISimpleAudioVolume_SetMute(this, Mute, EventContext) {
    return DllCall(NumGet(NumGet(this+0)+5*A_PtrSize), "uint", this, "int", Mute, "uint", VA_GUID(EventContext))
}
VA_ISimpleAudioVolume_GetMute(this, ByRef Mute) {
    return DllCall(NumGet(NumGet(this+0)+6*A_PtrSize), "uint", this, "int*", Mute)
}

3

Re: AHK: Свой gui микшер

Malcev
Ошибка (
микшер.ahk (10) : ==> Call to nonexistent function.
     Specifically: VA_GetDevice()
>Exit code: 2    Time: 0.05897

4

Re: AHK: Свой gui микшер

Вы бы читали, что запускаете:

; Requirements:
;   VA 2.1 - http://www.autohotkey.com/forum/topic23792.html

5

Re: AHK: Свой gui микшер

cahtbap1
http://forum.script-coding.com/viewtopic.php?id=8605

Win 10 x64
AHK v1.1.33.02
                       Справка тебе в помощь.