mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 17:26:41 +02:00
feat(mukke): support all common audio formats for upload and playback
Expand accepted audio formats beyond MP3/WAV/OGG to include FLAC, AAC, M4A, AIFF, OPUS, WMA, WebM, ALAC, APE, WavPack, DSF, and DFF. The HTML5 Audio player already handles whatever the browser supports. Changes: - BeatUploader: accept audio/* instead of hardcoded format list - shared-storage: add MIME type mappings for all common audio formats Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c3927c85f8
commit
7a1ae1284c
2 changed files with 38 additions and 6 deletions
|
|
@ -24,8 +24,7 @@
|
|||
let currentBeatId = $state<string | null>(null);
|
||||
let fileInputRef: HTMLInputElement;
|
||||
|
||||
const acceptedTypes = ['audio/mpeg', 'audio/wav', 'audio/ogg', 'audio/mp3', 'audio/x-wav'];
|
||||
const acceptedExtensions = '.mp3,.wav,.ogg';
|
||||
const acceptedExtensions = 'audio/*';
|
||||
|
||||
async function startTranscription(beatId: string) {
|
||||
isTranscribing = true;
|
||||
|
|
@ -56,8 +55,11 @@
|
|||
if (!file) return;
|
||||
|
||||
// Validate file type
|
||||
if (!acceptedTypes.includes(file.type) && !file.name.match(/\.(mp3|wav|ogg)$/i)) {
|
||||
errorMessage = 'Please select an audio file (MP3, WAV, or OGG)';
|
||||
if (
|
||||
!file.type.startsWith('audio/') &&
|
||||
!file.name.match(/\.(mp3|wav|ogg|flac|aac|m4a|wma|aiff|aif|opus|webm|alac|ape|wv|dsf|dff)$/i)
|
||||
) {
|
||||
errorMessage = 'Please select an audio file';
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -241,7 +243,9 @@
|
|||
<p class="text-foreground-secondary text-sm">
|
||||
Drag & drop or click to select an audio file
|
||||
</p>
|
||||
<p class="text-foreground-secondary text-xs mt-2">Supported formats: MP3, WAV, OGG</p>
|
||||
<p class="text-foreground-secondary text-xs mt-2">
|
||||
Supported formats: MP3, WAV, OGG, FLAC, AAC, M4A, AIFF, OPUS, WebM and more
|
||||
</p>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue