diff options
| author | stonedDiscord <stonedDiscord@users.noreply.github.com> | 2024-11-20 13:31:50 +0000 |
|---|---|---|
| committer | GitHub Action <actions@github.com> | 2024-11-20 13:31:50 +0000 |
| commit | 6684f3fce6e90fd0574d7bab63b629554ab03ef6 (patch) | |
| tree | b2a62247d17e23a77af57aea355ba621666817c2 /webAO/dom/opusCheck.ts | |
| parent | 95a2d1361d84c61b454ebe506e6963b93f6d8dee (diff) | |
Prettified Code!
Diffstat (limited to 'webAO/dom/opusCheck.ts')
| -rw-r--r-- | webAO/dom/opusCheck.ts | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/webAO/dom/opusCheck.ts b/webAO/dom/opusCheck.ts index 608a30a..90f5bb6 100644 --- a/webAO/dom/opusCheck.ts +++ b/webAO/dom/opusCheck.ts @@ -3,20 +3,20 @@ * @param {HTMLAudioElement} image the element containing the missing sound */ export function opusCheck( - channel: HTMLAudioElement + channel: HTMLAudioElement, ): OnErrorEventHandlerNonNull { - const audio = channel.src; - if (audio === "") { - return; - } - console.warn(`failed to load sound ${channel.src}`); - let oldsrc = ""; - let newsrc = ""; - oldsrc = channel.src; - if (!oldsrc.endsWith(".opus")) { - newsrc = oldsrc.replace(".mp3", ".opus"); - newsrc = newsrc.replace(".wav", ".opus"); - channel.src = newsrc; // unload so the old sprite doesn't persist - } + const audio = channel.src; + if (audio === "") { + return; + } + console.warn(`failed to load sound ${channel.src}`); + let oldsrc = ""; + let newsrc = ""; + oldsrc = channel.src; + if (!oldsrc.endsWith(".opus")) { + newsrc = oldsrc.replace(".mp3", ".opus"); + newsrc = newsrc.replace(".wav", ".opus"); + channel.src = newsrc; // unload so the old sprite doesn't persist + } } -window.opusCheck = opusCheck;
\ No newline at end of file +window.opusCheck = opusCheck; |
