From 9d9b32d47d3cad028e45ec81e9938c5513905968 Mon Sep 17 00:00:00 2001 From: Astrian Zheng Date: Mon, 26 May 2025 08:14:14 +1000 Subject: [PATCH] =?UTF-8?q?style(Playroom):=20=E4=B8=BA=E6=AD=8C=E6=9B=B2?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=92=8C=E8=89=BA=E6=9C=AF=E5=AE=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=B7=BB=E5=8A=A0=E6=88=AA=E6=96=AD=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=20refactor(audioVisualizer):=20=E8=B0=83=E6=95=B4=E9=9F=B3?= =?UTF-8?q?=E9=A2=91=E5=8F=AF=E8=A7=86=E5=8C=96=E9=A2=91=E7=8E=87=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E5=88=86=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为 Playroom 页面的歌曲名称和艺术家信息添加 truncate 样式,防止文本溢出 重构音频可视化频率范围分段,使其更符合人耳感知特性 --- src/pages/Playroom.vue | 4 ++-- src/utils/audioVisualizer.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pages/Playroom.vue b/src/pages/Playroom.vue index da10587..5290933 100644 --- a/src/pages/Playroom.vue +++ b/src/pages/Playroom.vue @@ -148,9 +148,9 @@ function makePlayQueueListDismiss() {
-
{{ playQueueStore.list[playQueueStore.currentIndex].song.name }} +
{{ playQueueStore.list[playQueueStore.currentIndex].song.name }}
-
+
{{ artistsOrganize(playQueueStore.list[playQueueStore.currentIndex].song.artists ?? []) }} — {{ playQueueStore.list[playQueueStore.currentIndex].album?.name ?? '未知专辑' }}
diff --git a/src/utils/audioVisualizer.ts b/src/utils/audioVisualizer.ts index 206f06f..ede6f81 100644 --- a/src/utils/audioVisualizer.ts +++ b/src/utils/audioVisualizer.ts @@ -170,11 +170,13 @@ export function audioVisualizer(options: AudioVisualizerOptions = {}) { // 定义人耳感知的频率范围 (Hz) const frequencyRanges = [ - { min: 20, max: 250, name: '低音' }, // 低音 - { min: 250, max: 2000, name: '中低音' }, // 中低音 - { min: 2000, max: 8000, name: '中高音' }, // 中高音 - { min: 8000, max: 20000, name: '高音' } // 高音 - ] + { min: 20, max: 80, name: '超低音' }, // 索引 0 + { min: 80, max: 250, name: '低音' }, // 索引 1 + { min: 250, max: 800, name: '中低音' }, // 索引 2 + { min: 800, max: 2500, name: '中音' }, // 索引 3 + { min: 2500, max: 6000, name: '中高音' }, // 索引 4 + { min: 6000, max: 20000, name: '高音' } // 索引 5 + ] for (let i = 0; i < bands; i++) { const range = frequencyRanges[i] || frequencyRanges[frequencyRanges.length - 1]