feat: cap bit depth/sample rate on lossless conversion + WAV/AIFF

- LosslessConversionQuality model with bit depth/sample rate caps,
  applied only when they reduce source quality
- FFmpegService probes sample rate and appends codec-specific args
  (-ar, -sample_fmt, -bits_per_raw_sample) for FLAC/ALAC/WAV/AIFF
- Batch + single-track convert sheets expose quality cap options
- Persist real converted bit depth/sample rate to history/library DB
- track_metadata: recognize and convert to WAV/AIFF targets
- convertedAudioQualityLabel reflects actual output quality
This commit is contained in:
zarzet
2026-06-29 06:46:19 +07:00
parent e9171d6f21
commit b2074dfd02
6 changed files with 606 additions and 51 deletions
+6
View File
@@ -1735,6 +1735,8 @@ class LibraryDatabase {
required String newFilePath,
required String targetFormat,
required String bitrate,
int? bitDepth,
int? sampleRate,
}) async {
final db = await database;
final stat = await fileStat(newFilePath);
@@ -1755,6 +1757,10 @@ class LibraryDatabase {
normalizedFormat == 'opus' ||
normalizedFormat == 'aac') {
updated['bitDepth'] = null;
updated['sampleRate'] = null;
} else {
updated['bitDepth'] = bitDepth ?? item.bitDepth;
updated['sampleRate'] = sampleRate ?? item.sampleRate;
}
await db.transaction((txn) async {