mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-06-29 17:50:00 +02:00
b8b670642c
WAV/AIFF: library scan, quality probe, native tag read/write via embedded ID3 chunk (RIFF id3 / AIFF ID3), cover art, ReadFileMetadata, ExtractLyrics, and FLAC<->WAV/AIFF conversion (PCM, bit-depth preserved via ffprobe). Treat WAV/AIFF as lossless across all convert sheets (no bitrate picker, Lossless labels) via isLosslessConversionTarget. Native MIME maps for SAF. Redesign the track metadata three-dot menu to a settings-style grouped card with a single divider above Share.
29 lines
633 B
Dart
29 lines
633 B
Dart
String audioMimeTypeForPath(String filePath) {
|
|
final dotIndex = filePath.lastIndexOf('.');
|
|
if (dotIndex == -1 || dotIndex == filePath.length - 1) {
|
|
return 'audio/*';
|
|
}
|
|
|
|
final ext = filePath.substring(dotIndex + 1).toLowerCase();
|
|
switch (ext) {
|
|
case 'flac':
|
|
return 'audio/flac';
|
|
case 'm4a':
|
|
return 'audio/mp4';
|
|
case 'mp3':
|
|
return 'audio/mpeg';
|
|
case 'ogg':
|
|
return 'audio/ogg';
|
|
case 'wav':
|
|
return 'audio/wav';
|
|
case 'aiff':
|
|
case 'aif':
|
|
case 'aifc':
|
|
return 'audio/aiff';
|
|
case 'aac':
|
|
return 'audio/aac';
|
|
default:
|
|
return 'audio/*';
|
|
}
|
|
}
|