@@ -72,6 +72,23 @@ class CodecUtils {
|
||||
};
|
||||
}
|
||||
|
||||
/// Formats an audio channel count as a friendly layout name (2 → 'Stereo',
|
||||
/// 6 → '5.1'). Returns null when [channels] is null or not positive.
|
||||
static String? formatAudioChannels(int? channels) {
|
||||
if (channels == null || channels <= 0) return null;
|
||||
return switch (channels) {
|
||||
1 => 'Mono',
|
||||
2 => 'Stereo',
|
||||
3 => '3.0',
|
||||
4 => '4.0',
|
||||
5 => '4.1',
|
||||
6 => '5.1',
|
||||
7 => '6.1',
|
||||
8 => '7.1',
|
||||
_ => '${channels}ch',
|
||||
};
|
||||
}
|
||||
|
||||
/// Formats an audio codec name to a user-friendly display format.
|
||||
static String formatAudioCodec(String codec) {
|
||||
final lower = codec.toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user