feat: 支持 M4A/ALAC 交付并修复 96kHz M4A/MP3 下载问题#11
Merged
Conversation
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
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.
🎯 Changes
1. M4A/ALAC 无损格式交付支持
DownloadModal.tsx中新增 M4A 下载按钮(橙色),支持合并轨、人声轨、伴奏轨、单轨下载。/download-m4a/{task_id}端点,支持单轨/双轨合并与 Range 请求。backend/services/m4a_encoder.py模块,实现基于 ffmpeg subprocess 的 M4A/ALAC 编码器。public/flow-data.json,新增/download-m4a/{task_id}节点及数据流关系。2. 修复 96kHz 渲染后 M4A/MP3 下载为 48kHz 的问题
/download-mp3-file/{filename}端点,直接按渲染产物文件名转码 MP3,保留 96kHz 采样率。/download-m4a-file/{filename}端点,直接按渲染产物文件名转码 M4A/ALAC,保留 96kHz 采样率。DownloadModal.tsx中的handleDownloadMp3和新增handleDownloadM4a,支持通过taskId或url两种路径调用,优先使用url中的filename路径以保留 96kHz 采样率。fix-m4a-96khz-bug.md,详细说明问题根因及修复方案。3. 其他改进
DownloadModal.tsx新增m4aLoading/m4aError状态及模态打开时的重置逻辑。public/flow-data.json中的__pycache__模块节点及其调用关系。💡 Technical Highlights
taskId和url两种路径,优先使用url中的filename直接转码,以确保 96kHz 采样率的保留,同时兼容旧的taskId逻辑。ffmpeg subprocess实现 M4A/ALAC 编码,支持可用性检测、版本查询、转码、日志与异常处理,确保编码过程的稳定性和可靠性。