From 362f7546818607bde6717fdcbb8247203d407ff2 Mon Sep 17 00:00:00 2001 From: khlam <4841220+khlam@users.noreply.github.com> Date: Sat, 12 Oct 2019 22:09:37 -0700 Subject: [PATCH] double mute after double tap solved --- assets/icon.ico | Bin 9893 -> 5486 bytes main.js | 74 ++++++++++++++++++++++++++++++------------------ 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/assets/icon.ico b/assets/icon.ico index 0cdb4c426746e592852da2dc5ece83e1e21440e5..5517f6f0df90631c25652a514707908d67de50cb 100644 GIT binary patch literal 5486 zcmcIoS5#BWyWdHG&^02x8VS-tL5xUKgRnu0NE3RHMK@hmxhx>G2?!&#a*Is*OeZTLU-^`vhUjYCZ^!#ZsKnw7d z2LJ`Af6d+1K}J$V66(r;jyR7$(m$`b81(UvtqcYLc});^*fXJcev;CR@ha&1Fg@&Y ze*0@38hW2rvsRT@}0K-&e@DmsPyCQ@74hAv_V zkuODE0pshm-U0!C)DB5y+)G&j0)Y3g{4@6tyx{!BF+tCaPV|z(2nai_H)k7|wjSK! zFQv8}l{ah5P(2x|_*xHi2G=a3QJV{=lT{Il;951Ksw0CxWTy^u^pn8Kj2Kglf&*6( z^`~)zukem6F&&5nGI?8gAxoi2Vo)SLo%VN!6tUkyJfdA~!~$J9h<7wd zjg{ertUirO4K(BRcVvV*%tK6I9E}cvso*sWGoQzzd7n>`)ZzzmZZJwO2B!ww)c=K> zC}L$T4sD3@#D9Nid)$IvcrjsroYCq4&@Dum6`Q+)EKo32ho0pQDP`vpTmP~LQ_BS{ zyQyw-#%HZstl+wqzXxIWKQnu4Mcm+FLk+3!_^l^hQkPaE{`J*Ja1f&VJcfZ0Jqj!s zGrpGs3#=08al&~Rh?Bt^HfphP!v4A^3&?5~iw+Q44(it@;;iynwDPYBlBT;MCHbn! zE_^?bKor6U^&5kQ@MG11Ky5w?Xi6W7oMr|BhIxPbhGi^j_E#mKg=I?grjN~!lcfPO zfgF;0D)k^Rs4@s6yeG&4O=59C{{DOfr}nWL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1Q>Py<3d!#p`QoFY%jU* z2TO)CdHTUiep>xAjiG6SsZSdn+p*AtO=}>^GI^%IiRswMb&~Va27DK3VZ9QDC_ZL0 z?9xc=mB7w(vdHhF2c`#KuY1><4{4cx2Uk{5fw1%pu}e&x#lG73tgH!$VsZhmEVwYA zz(}`LVmRR4?ycpuw>hZ}U_9v`(+PPbpvAoX$H!7EaRl@0sk_XN5iJ<}K5_do&sFFR zRonLWKqYuiyHyb7i%570jo8R)F@TENdl3{B61qkXCHv`&F|qjZM)`^^m3yxi*NGxi zC*zwLpn^SyOvM3s%_;Ud{`BFw@R5tras7&(A>IWb(871!$j e;BW1tas56rY?Ow_hhT_iSU_d%SCxvdKmIShPIa{a diff --git a/main.js b/main.js index 8a08b11..9e47d92 100644 --- a/main.js +++ b/main.js @@ -61,48 +61,68 @@ const ioHook = require('iohook') const win = require('win-audio') const microphone = win.mic -let talkOpen = false -function toggleMicOpen() { - if (talkOpen === false) { - setTimeout(function (){ - talkOpen = false - console.log("Muted") - mainWindow.webContents.send('ping', 'mic-closed') - mainWindow.setTitle("MUTED") - microphone.mute(); - }, 2000); - }else { - talkOpen = true +let isTalking = false + +// Resolves the promise after 2 seconds +function muteDelay() { + return new Promise((resolve) => { + setTimeout(function(){ + return resolve(true) + }, 1300); + }) +} + +// Mutes the Mic +function muteMic() { + return new Promise((resolve) => { + if (isTalking === false) { + muteDelay().then(val => { + if (isTalking === false) { + microphone.mute(); // Mute mic + console.log("Muted") + mainWindow.webContents.send('ping', 'mic-closed') + mainWindow.setTitle("MUTED") + return resolve(true) + } + }) + } + }) +} + +function unmuteMic() { + return new Promise((resolve, reject) => { console.log("Talking") + isTalking = true mainWindow.webContents.send('ping', 'mic-open') mainWindow.setTitle("MIC OPEN") - microphone.unmute(); - } + microphone.unmute(); // Unmute mic + return resolve(true) + }) } app.on('ready', event => { - talkOpen = false - toggleMicOpen() ioHook.start(); - ioHook.start(true); - console.log("Init done") + + console.log("Init Finished") + + console.log("Muted") + microphone.mute(); + mainWindow.webContents.send('ping', 'mic-closed') + mainWindow.setTitle("MUTED") }) ioHook.on('mousedown', event => { if (event.button == '4') { - if (talkOpen === false) { - talkOpen = true - toggleMicOpen() - } + unmuteMic() } }) ioHook.on('mouseup', event => { if (event.button == '4') { - if (talkOpen === true) { - talkOpen = false - toggleMicOpen() - } + isTalking = false + muteMic() } -}) \ No newline at end of file +}) + +