feat: 双声道频谱可视化#79
Open
kyv001 wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动类型
是否包含破坏性变更
改动说明
该 PR 将播放界面的 FFT 频谱从单声道计算变为双声道,频谱左翼显示左声道、右翼显示右声道。
Rust 原生模块方面使
fft_resampler也进行双声道采样而不是单声道,使FftAnalyzer原生支持交替双声道输入并返回两个声道各自频谱数据给JavaScript部分,并提取部分公共逻辑为单独函数以减少重复代码;JavaScript/TypeScript部分用
FftData { ldata, rdata }或者[number[], number[]]代替原先的number[]以支持双声道频谱数据;绘图部分取消原有对称画图逻辑,将双声道频谱数据预先连接为一个整体再统一平滑并绘制。
测试情况
播放任意一首有明显不对称乐器摆位的音乐,可以观察到现在的频谱不再是完全对称的,而是各自反映左右声道信息。
截图 / 录屏
图中左声道有一吉他,也确实显示在了频谱左翼中且右翼没有相关信号。

自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.tsdev分支提交