You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

多轨同步Transport的PitchShift音效失真且随时间恶化的原因排查

多轨音频播放器整体音调调整音效异常问题

我正在开发一款基于React的多轨音频播放器,目前已实现单独调节每轨音量的功能且运行正常,但在实现所有轨道整体音调调整时遇到严重问题:执行音调调整后音效极差,且在30秒音频播放过程中情况持续恶化。

为直观展示目标效果,以下是开发后的大致UI界面(音频轨道由Logic DAW导出):
多轨音频播放器UI

轨道初始化代码

const initAudio = () => {

  const files = [
    "Accompaniment Those Memories of You.wav",
    "Baritone Those Memories of You.wav",
    "Lead Those Memories of You.wav",
    "Tenor Those Memories of You.wav",
  ]

  tracks = files.map(
    filename => {
      let pitchShift = new Tone.PitchShift().toDestination()
      const player = new Tone.Player(
        {
          url: 'audio/' + filename,
          loop: false
        }
      ).connect(pitchShift).sync().start(0)
      
      return {
        player,
        pitchShift,
        name: filename.split('.')[0],
      }
    }
  )
}

音调调整实现代码(存在问题)

const changePitch = (changeVal) => {
  tracks.forEach(
    track => track['pitchShift'].pitch = track['pitchShift'].pitch + changeVal
  )
}

我不确定问题源于以下哪一点(或其他原因):

  • connect或toDestination的设置/使用错误(我是Tone.js新手)
  • Transport的固有同步问题
  • 处理器性能限制
  • 其他

希望能解决这个音效异常的问题,目前效果糟糕得离谱。是否存在明显错误?另外,我也曾尝试使用单个pitchShift对象连接所有轨道,若需要可提供完整组件代码。

内容的提问来源于stack exchange,提问作者pixelearth

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 16:42:36