feat(ui): show sample rate in the audio quality string (FLAC 24bit/96kHz)
get_audio_quality_string now appends the FLAC sample rate so the Downloads quality chip and library history read e.g. 'FLAC 24bit/96kHz' instead of just 'FLAC 24bit' — surfaces hi-res frequency (44.1/48/96/192kHz) at a glance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
62d5821d26
commit
11d2fa9ad6
1 changed files with 3 additions and 0 deletions
|
|
@ -192,6 +192,9 @@ def get_audio_quality_string(file_path):
|
|||
if ext == ".flac":
|
||||
from mutagen.flac import FLAC
|
||||
audio = FLAC(file_path)
|
||||
sr = getattr(audio.info, "sample_rate", 0) or 0
|
||||
if sr:
|
||||
return f"FLAC {audio.info.bits_per_sample}bit/{sr / 1000:g}kHz"
|
||||
return f"FLAC {audio.info.bits_per_sample}bit"
|
||||
|
||||
if ext == ".mp3":
|
||||
|
|
|
|||
Loading…
Reference in a new issue