aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_music.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-06-06 02:09:46 +0200
committerMinteck <nekostarfan@gmail.com>2021-06-06 02:09:46 +0200
commitba7cd4308d21505455fdc522403e1158c8253d7f (patch)
treeec61d3f0b0c0f42a7a764985073c3437eed7afa6 /views/script/core_music.js
parentb2acaf4dc788d6a8682f20f14bc64ce83639c9ae (diff)
downloadkartik-client-ba7cd4308d21505455fdc522403e1158c8253d7f.tar.gz
kartik-client-ba7cd4308d21505455fdc522403e1158c8253d7f.tar.bz2
kartik-client-ba7cd4308d21505455fdc522403e1158c8253d7f.zip
Fix audio
Diffstat (limited to 'views/script/core_music.js')
-rw-r--r--views/script/core_music.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/views/script/core_music.js b/views/script/core_music.js
index d1e8619..adb0ae2 100644
--- a/views/script/core_music.js
+++ b/views/script/core_music.js
@@ -5,6 +5,8 @@ global.cspn = 1;
const musicIpc = require('electron').ipcRenderer;
musicIpc.on('setmusic', (event, args) => {
+ try { csp1.volume = 0; } catch (e) {}
+ try { csp2.volume = 0; } catch (e) {}
song = args;
if (song !== null && song !== "" && csng !== song) {
@@ -13,6 +15,7 @@ musicIpc.on('setmusic', (event, args) => {
csi1 = setInterval(() => {
if (csp1.volume <= 0.05) {
csp1.pause();
+ csp1.volume = 0;
clearInterval(csi1);
return;
}
@@ -37,6 +40,7 @@ musicIpc.on('setmusic', (event, args) => {
csi2 = setInterval(() => {
if (csp2.volume <= 0.05) {
csp2.pause();
+ csp2.volume = 0;
clearInterval(csi2);
return;
}
@@ -64,7 +68,7 @@ musicIpc.on('fademusic', (event) => {
if (cspn === 1) {
if (csp1 !== null) {
csi1 = setInterval(() => {
- if (csp1.volume <= 0.5) {
+ if (csp1.volume <= 0.05) {
clearInterval(csi1);
return;
}
@@ -74,7 +78,7 @@ musicIpc.on('fademusic', (event) => {
} else {
if (csp2 !== null) {
csi2 = setInterval(() => {
- if (csp2.volume <= 0.5) {
+ if (csp2.volume <= 0.05) {
clearInterval(csi2);
return;
}