fixed bit depth and sample rate info on hires flacs

This commit is contained in:
uh wot
2023-07-12 02:59:01 +02:00
parent d19583413a
commit 50ce6dbf61

View File

@@ -506,7 +506,8 @@ class ModuleInterface:
download_args = {'file_url': manifest['urls'][0]}
# https://en.wikipedia.org/wiki/Audio_bit_depth#cite_ref-1
bit_depth = 16 if track_codec in {CodecEnum.FLAC, CodecEnum.ALAC} else None
bit_depth = (24 if stream_data and stream_data['audioQuality'] == 'HI_RES_LOSSLESS' else 16) \
if track_codec in {CodecEnum.FLAC, CodecEnum.ALAC} else None
sample_rate = 48 if track_codec in {CodecEnum.EAC3, CodecEnum.MHA1, CodecEnum.AC4} else 44.1
if stream_data:
@@ -532,6 +533,8 @@ class ModuleInterface:
# more precise bitrate tidal uses MPEG-DASH
if audio_track:
bitrate = audio_track.bitrate // 1000
if stream_data['audioQuality'] == 'HI_RES_LOSSLESS':
sample_rate = audio_track.sample_rate / 1000
# now set everything for MQA
if mqa_file is not None and mqa_file.is_mqa: