2019-10-12 02:52:09 +00:00
|
|
|
require('electron').ipcRenderer.on('ping', (event, message) => {
|
|
|
|
if (message === 'mic-open'){
|
|
|
|
console.log("mic is open")
|
2019-10-12 23:49:31 +00:00
|
|
|
playSound()
|
2019-10-12 02:52:09 +00:00
|
|
|
}
|
|
|
|
if (message === 'mic-closed'){
|
|
|
|
console.log("mic is closed")
|
2019-10-12 23:49:31 +00:00
|
|
|
playSound()
|
2019-10-12 02:52:09 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2019-10-12 23:49:31 +00:00
|
|
|
function playSound() {
|
|
|
|
var sound = document.getElementById("audio");
|
|
|
|
sound.volume=0.3
|
|
|
|
sound.play();
|
|
|
|
}
|