From b122dd73516d7262872da8fe8e4ce22a87be1046 Mon Sep 17 00:00:00 2001 From: brysonbw Date: Sun, 7 Dec 2025 12:12:22 -0700 Subject: [PATCH 1/2] update default volume param value --- src/services/web-audio-api.service.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/services/web-audio-api.service.js b/src/services/web-audio-api.service.js index 9025e94..2c72233 100644 --- a/src/services/web-audio-api.service.js +++ b/src/services/web-audio-api.service.js @@ -1,8 +1,5 @@ -import { - AUDIO_SOUND, - AUDIO_VOLUME, - CLIENT_ERROR_MESSAGE, -} from '../utils/constants.js'; +import { DEFAULT_SETTINGS } from '../stores/settings.js'; +import { AUDIO_SOUND, CLIENT_ERROR_MESSAGE } from '../utils/constants.js'; class WebAudioApiService { /** @type {AudioContext | undefined} */ @@ -59,7 +56,7 @@ class WebAudioApiService { * @param {number} volume * @returns {GainNode} */ - #createGain(volume = AUDIO_VOLUME.ONE_HUNDRED_PERCENT) { + #createGain(volume = DEFAULT_SETTINGS.audioVolume) { const gainNode = /** @type {GainNode} */ (this.#audioContext?.createGain()); gainNode.gain.value = Math.min(Math.max(volume / 100, 0), 1); const destination = /** @type {AudioDestinationNode} */ ( @@ -74,7 +71,7 @@ class WebAudioApiService { * @param {number} volume * @returns {Promise} */ - async playSound(id, volume = AUDIO_VOLUME.ONE_HUNDRED_PERCENT) { + async playSound(id, volume = DEFAULT_SETTINGS.audioVolume) { if (!this.#audioContext) { console.error( `${CLIENT_ERROR_MESSAGE.PLAY_SOUND_FAILED} AudioContext unavailable.` From 40af543b993d6aaf4a905d04373d8f3de53c577f Mon Sep 17 00:00:00 2001 From: brysonbw Date: Sun, 7 Dec 2025 12:12:46 -0700 Subject: [PATCH 2/2] lint/fix file --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 183f73c..7909a28 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,7 +4,7 @@ ## Change(s) -