diff options
| author | sD <stoned@derpymail.org> | 2020-06-01 12:47:28 +0200 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2020-06-01 12:47:28 +0200 |
| commit | 3b591a5d7309b07ff8f47d936e3b145c7c4d8017 (patch) | |
| tree | eb6563820309a9c5dcf97c2d743807c243f64442 /webAO/client.js | |
| parent | 46198ff2ee444285da5084d680c66ad766b5af95 (diff) | |
let the user control more of the audio
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/webAO/client.js b/webAO/client.js index da6acb4..52b7976 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -414,8 +414,10 @@ class Client extends EventEmitter { document.getElementById("client_musicaudio").volume = getCookie("musicVolume") || 1; changeMusicVolume(); - document.getElementById("client_svolume").value = getCookie("sfxVolume") || 1; + document.getElementById("client_sfxaudio").volume = getCookie("sfxVolume") || 1; changeSFXVolume(); + document.getElementById("client_shoutaudio").volume = getCookie("shoutVolume") || 1; + changeShoutVolume(); document.getElementById("client_bvolume").value = getCookie("blipVolume") || 1; changeBlipVolume(); @@ -1316,13 +1318,16 @@ class Viewport { .forEach(channel => channel.volume = 0.5); this.currentBlipChannel = 0; - this.sfxaudio = new Audio(AO_HOST + "sounds/general/sfx-blipmale.wav"); + this.sfxaudio = document.getElementById("client_sfxaudio"); + this.sfxaudio.src = `${AO_HOST}sounds/general/sfx-realization.wav`; + this.sfxplayed = 0; - this.shoutaudio = new Audio(); + this.shoutaudio = document.getElementById("client_shoutaudio"); + this.shoutaudio.src = `${AO_HOST}misc/default/objection.wav`; this.music = document.getElementById("client_musicaudio"); - this.music.play(); + this.music.src = `${AO_HOST}sounds/music/trial (aa).mp3`; this.updater = null; this.testimonyUpdater = null; @@ -2153,13 +2158,19 @@ window.changeMusicVolume = changeMusicVolume; * Triggered by the sound effect volume slider. */ export function changeSFXVolume() { - viewport.sfxaudio.volume = document.getElementById("client_svolume").value; - viewport.shoutaudio.volume = document.getElementById("client_svolume").value; - setCookie("sfxVolume", document.getElementById("client_svolume").value); + setCookie("sfxVolume", document.getElementById("client_sfxaudio").volume); } window.changeSFXVolume = changeSFXVolume; /** + * Triggered by the shout volume slider. + */ +export function changeShoutVolume() { + setCookie("shoutVolume", document.getElementById("client_shoutaudio").volume); +} +window.changeShoutVolume = changeShoutVolume; + +/** * Triggered by the blip volume slider. */ export function changeBlipVolume() { |
