From 16d0dd425f3e432fbfa598478f97cfdb26d94181 Mon Sep 17 00:00:00 2001 From: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> Date: Sat, 26 Dec 2020 18:22:53 +0100 Subject: use opus instead of uncompressed wav --- webAO/client.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'webAO') diff --git a/webAO/client.js b/webAO/client.js index 4bd7e4e..3b275c0 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -150,22 +150,22 @@ class Client extends EventEmitter { "witnesstestimony": { "src": AO_HOST + "themes/" + THEME + "/witnesstestimony.gif", "duration": 1560, - "sfx": AO_HOST + "sounds/general/sfx-testimony.wav" + "sfx": AO_HOST + "sounds/general/sfx-testimony.opus" }, "crossexamination": { "src": AO_HOST + "themes/" + THEME + "/crossexamination.gif", "duration": 1600, - "sfx": AO_HOST + "sounds/general/sfx-testimony2.wav" + "sfx": AO_HOST + "sounds/general/sfx-testimony2.opus" }, "guilty": { "src": AO_HOST + "themes/" + THEME + "/guilty.gif", "duration": 2870, - "sfx": AO_HOST + "sounds/general/sfx-guilty.wav" + "sfx": AO_HOST + "sounds/general/sfx-guilty.opus" }, "notguilty": { "src": AO_HOST + "themes/" + THEME + "/notguilty.gif", "duration": 2440, - "sfx": AO_HOST + "sounds/general/sfx-notguilty.wav" + "sfx": AO_HOST + "sounds/general/sfx-notguilty.opus" }, }; @@ -1210,7 +1210,7 @@ class Client extends EventEmitter { viewport.sfxaudio.pause(); const oldvolume = viewport.sfxaudio.volume; viewport.sfxaudio.volume = 1; - viewport.sfxaudio.src = AO_HOST + "sounds/general/sfx-gallery.wav"; + viewport.sfxaudio.src = AO_HOST + "sounds/general/sfx-gallery.opus"; viewport.sfxaudio.play(); viewport.sfxaudio.volume = oldvolume; } @@ -1551,23 +1551,23 @@ class Viewport { // Allocate multiple blip audio channels to make blips less jittery this.blipChannels = new Array(6); - this.blipChannels.fill(new Audio(AO_HOST + "sounds/general/sfx-blipmale.wav")) + this.blipChannels.fill(new Audio(AO_HOST + "sounds/general/sfx-blipmale.opus")) .forEach(channel => channel.volume = 0.5); this.currentBlipChannel = 0; this.sfxaudio = document.getElementById("client_sfxaudio"); - this.sfxaudio.src = `${AO_HOST}sounds/general/sfx-realization.wav`; + this.sfxaudio.src = `${AO_HOST}sounds/general/sfx-realization.opus`; this.sfxplayed = 0; this.shoutaudio = document.getElementById("client_shoutaudio"); - this.shoutaudio.src = `${AO_HOST}misc/default/objection.wav`; + this.shoutaudio.src = `${AO_HOST}misc/default/objection.opus`; this.testimonyAudio = document.getElementById("client_testimonyaudio"); - this.testimonyAudio.src = `${AO_HOST}sounds/general/sfx-guilty.wav`; + this.testimonyAudio.src = `${AO_HOST}sounds/general/sfx-guilty.opus`; this.music = new Array(3); - this.music.fill(new Audio(`${AO_HOST}sounds/music/trial (aa).mp3`)) + this.music.fill(new Audio(`${AO_HOST}sounds/music/trial (aa).opus`)) .forEach(channel => channel.volume = 0.5); this.updater = null; @@ -1938,7 +1938,7 @@ async changeBackground(position) { shoutSprite.style.opacity = 1; - this.shoutaudio.src = `${AO_HOST}characters/${encodeURI(this.chatmsg.name.toLowerCase())}/${shout}.wav`; + this.shoutaudio.src = `${AO_HOST}characters/${encodeURI(this.chatmsg.name.toLowerCase())}/${shout}.opus`; this.shoutaudio.play(); this.shoutTimer = client.resources[shout]["duration"]; } else { @@ -1985,7 +1985,7 @@ async changeBackground(position) { pairLayers.style.transform = "scaleX(1)"; } - this.blipChannels.forEach(channel => channel.src = `${AO_HOST}sounds/general/sfx-blip${encodeURI(this.chatmsg.blips.toLowerCase())}.wav`); + this.blipChannels.forEach(channel => channel.src = `${AO_HOST}sounds/general/sfx-blip${encodeURI(this.chatmsg.blips.toLowerCase())}.opus`); // process markup if(this.chatmsg.content.startsWith("~~")) { @@ -2065,12 +2065,12 @@ async changeBackground(position) { // Effect stuff if (this.chatmsg.screenshake === 1) { // Shake screen - this.playSFX(AO_HOST + "sounds/general/sfx-stab.wav", false); + this.playSFX(AO_HOST + "sounds/general/sfx-stab.opus", false); gamewindow.style.animation = "shake 0.2s 1"; } if (this.chatmsg.flash === 1) { // Flash screen - this.playSFX(AO_HOST + "sounds/general/sfx-realization.wav", false); + this.playSFX(AO_HOST + "sounds/general/sfx-realization.opus", false); effectlayer.style.animation = "flash 0.4s 1"; } @@ -2104,7 +2104,7 @@ async changeBackground(position) { eviBox.style.height = "36.5%"; eviBox.style.opacity = 1; - this.testimonyAudio.src = AO_HOST + "sounds/general/sfx-evidenceshoop.wav"; + this.testimonyAudio.src = AO_HOST + "sounds/general/sfx-evidenceshoop.opus"; this.testimonyAudio.play(); if (this.chatmsg.side === "def") { @@ -2181,7 +2181,7 @@ async changeBackground(position) { if (!this.sfxplayed && this.chatmsg.snddelay + this.shoutTimer >= this.textTimer) { this.sfxplayed = 1; if (this.chatmsg.sound !== "0" && this.chatmsg.sound !== "1" && this.chatmsg.sound !== "" && this.chatmsg.sound !== undefined) { - this.playSFX(AO_HOST + "sounds/general/" + encodeURI(this.chatmsg.sound.toLowerCase()) + ".wav", this.chatmsg.looping_sfx); + this.playSFX(AO_HOST + "sounds/general/" + encodeURI(this.chatmsg.sound.toLowerCase()) + ".opus", this.chatmsg.looping_sfx); } } this.textTimer = this.textTimer + UPDATE_INTERVAL; @@ -2742,7 +2742,7 @@ export function checkCallword(message) { if(item !== "" && message.toLowerCase().includes(item.toLowerCase())) { viewport.sfxaudio.pause(); - viewport.sfxaudio.src = AO_HOST + "sounds/general/sfx-gallery.wav"; + viewport.sfxaudio.src = AO_HOST + "sounds/general/sfx-gallery.opus"; viewport.sfxaudio.play(); } } -- cgit