discord-sandboxed/renderer.js
2019-10-12 17:21:12 -07:00

22 lines
533 B
JavaScript

const customTitlebar = require('custom-electron-titlebar');
t = new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#444')
});
require('electron').ipcRenderer.on('ping', (event, message) => {
if (message === 'mic-open'){
console.log("mic is open")
playSound()
}
if (message === 'mic-closed'){
console.log("mic is closed")
playSound()
}
})
function playSound() {
var sound = document.getElementById("audio");
sound.volume=0.3
sound.play();
}