mute desktop audio when homepod is playing

This commit is contained in:
vapormusic 2022-04-23 19:46:07 +07:00
parent fa20e222e0
commit f5a816467f

View file

@ -170,6 +170,7 @@ export default class RAOP {
this.device.on('status', (status: any) => { this.device.on('status', (status: any) => {
console.log('device status', status); console.log('device status', status);
if (status == "ready"){ if (status == "ready"){
this._win.webContents.setAudioMuted(true);
this._win.webContents.executeJavaScript(`CiderAudio.sendAudio()`).catch((err: any) => console.error(err)); this._win.webContents.executeJavaScript(`CiderAudio.sendAudio()`).catch((err: any) => console.error(err));
} }
if (status == 'stopped') { if (status == 'stopped') {
@ -256,6 +257,7 @@ export default class RAOP {
electron.ipcMain.on('disconnectAirplay', (event) => { electron.ipcMain.on('disconnectAirplay', (event) => {
this._win.webContents.setAudioMuted(false);
this.airtunes.stopAll(function () { this.airtunes.stopAll(function () {
console.log('end'); console.log('end');
}); });