| import { FileTypeAudio, MimeTypeAudio } from '$lib/enums'; | |
| import type { AudioInputFormat } from '$lib/types/api'; | |
| /** | |
| * Map a MIME type to the AudioInputFormat expected by the API. | |
| */ | |
| export function getAudioInputFormat(mimeType: string): AudioInputFormat { | |
| const normalizedMimeType = mimeType.trim().toLowerCase(); | |
| if ( | |
| normalizedMimeType === MimeTypeAudio.WAV || | |
| normalizedMimeType === MimeTypeAudio.WAVE || | |
| normalizedMimeType === MimeTypeAudio.X_WAV || | |
| normalizedMimeType === MimeTypeAudio.X_WAVE || | |
| normalizedMimeType === MimeTypeAudio.VND_WAVE || | |
| normalizedMimeType === MimeTypeAudio.X_PN_WAV | |
| ) { | |
| return FileTypeAudio.WAV; | |
| } | |
| return FileTypeAudio.MP3; | |
| } | |
Xet Storage Details
- Size:
- 683 Bytes
- Xet hash:
- 1d8be5ce5c18a239bf303a638a519ecaa7fd00ef966c1ab007dfd7c051571a60
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.