ui: add OGG audio format support to transcription playground (#544)

This commit is contained in:
Benson Wong
2026-02-26 19:48:19 -08:00
committed by GitHub
parent 64e4c79fc3
commit 2f377f6dc6
@@ -16,7 +16,7 @@
let fileInput = $state<HTMLInputElement | null>(null); let fileInput = $state<HTMLInputElement | null>(null);
let copied = $state(false); let copied = $state(false);
const ACCEPTED_FORMATS = ['.mp3', '.wav']; const ACCEPTED_FORMATS = ['.mp3', '.wav', '.ogg'];
const MAX_FILE_SIZE = 25 * 1024 * 1024; // 25MB const MAX_FILE_SIZE = 25 * 1024 * 1024; // 25MB
let hasModels = $derived($models.some((m) => !m.unlisted)); let hasModels = $derived($models.some((m) => !m.unlisted));
@@ -31,7 +31,7 @@
const ext = '.' + file.name.split('.').pop()?.toLowerCase(); const ext = '.' + file.name.split('.').pop()?.toLowerCase();
if (!ACCEPTED_FORMATS.includes(ext)) { if (!ACCEPTED_FORMATS.includes(ext)) {
return { valid: false, error: 'Invalid file type. Accepted: MP3, WAV' }; return { valid: false, error: 'Invalid file type. Accepted: MP3, WAV, OGG' };
} }
if (file.size > MAX_FILE_SIZE) { if (file.size > MAX_FILE_SIZE) {
@@ -208,7 +208,7 @@
<div> <div>
<p class="mb-2">Drag and drop an audio file here</p> <p class="mb-2">Drag and drop an audio file here</p>
<p class="text-sm">or use the Browse button below</p> <p class="text-sm">or use the Browse button below</p>
<p class="text-xs mt-4">Accepted formats: MP3, WAV (max 25MB)</p> <p class="text-xs mt-4">Accepted formats: MP3, WAV, OGG (max 25MB)</p>
</div> </div>
</div> </div>
{/if} {/if}
@@ -218,7 +218,7 @@
<div class="shrink-0 flex gap-2"> <div class="shrink-0 flex gap-2">
<input <input
type="file" type="file"
accept=".mp3,.wav" accept=".mp3,.wav,.ogg"
class="hidden" class="hidden"
onchange={handleFileSelect} onchange={handleFileSelect}
bind:this={fileInput} bind:this={fileInput}