aboutsummaryrefslogtreecommitdiff
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
parentb2acaf4dc788d6a8682f20f14bc64ce83639c9ae (diff)
downloadkartik-client-ba7cd4308d21505455fdc522403e1158c8253d7f.tar.gz
kartik-client-ba7cd4308d21505455fdc522403e1158c8253d7f.tar.bz2
kartik-client-ba7cd4308d21505455fdc522403e1158c8253d7f.zip
Fix audio
-rw-r--r--package.json2
-rw-r--r--views/script/core_music.js8
2 files changed, 7 insertions, 3 deletions
diff --git a/package.json b/package.json
index c2e6c89..b4a873b 100644
--- a/package.json
+++ b/package.json
@@ -1 +1 @@
-{"name":"kartik","version":"d4caa42","channel":"git","description":"A multiplatform 2D karting game","main":"app.js","dependencies":{"@electron/remote":"^1.0.4","discord-rpc":"^3.2.0","electron":"^12.0.1","ini":"^1.3.8","jquery":"^3.6.0","os-locale":"^5.0.0","uuid":"^8.3.2","yaml":"^1.10.2"},"scripts":{"test":"node_modules\\electron\\dist\\electron.exe app.js"},"author":"Minteck Projects","license":"UNLICENSED","serial":"XXX99999999999"} \ No newline at end of file
+{"name":"kartik","version":"b2acaf4","channel":"git","description":"A multiplatform 2D karting game","main":"app.js","dependencies":{"@electron/remote":"^1.0.4","discord-rpc":"^3.2.0","electron":"^12.0.1","ini":"^1.3.8","jquery":"^3.6.0","os-locale":"^5.0.0","uuid":"^8.3.2","yaml":"^1.10.2"},"scripts":{"test":"node_modules\\electron\\dist\\electron.exe app.js"},"author":"Minteck Projects","license":"UNLICENSED","serial":"XXX99999999999"} \ No newline at end of file
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;
}