Gap 13: BWF/INFO metadata cho WAV export — wav_bwf.patch_bwf_metadata chen bext + LIST/INFO (INAM/IART/ISRC/ICMT) truoc data chunk, giu nguyen PCM bits; render_project(metadata=) + RenderRequest.metadata + cloud render task; ExportModal Title/Artist/ISRC; test_66 (178 passed)
This commit is contained in:
@@ -839,7 +839,9 @@ class PythonRenderEngine:
|
||||
def render_project(self, project_json: dict, output_filepath: str,
|
||||
bit_depth: int = 32, out_sample_rate: int = 0,
|
||||
dither: bool = False, normalize: bool = False,
|
||||
normalize_target: str = "-1dbtp"):
|
||||
normalize_target: str = "-1dbtp",
|
||||
metadata: dict = None):
|
||||
# Gap 13: BWF/INFO metadata — tham số phụ, không đổi hành vi cũ khi None.
|
||||
with RENDER_LOCK:
|
||||
bpm = project_json["metadata"]["bpm"]
|
||||
time_sig_num = project_json["metadata"].get("time_signature_numerator", 4)
|
||||
@@ -963,4 +965,12 @@ class PythonRenderEngine:
|
||||
out_sr, subtype="PCM_24")
|
||||
else:
|
||||
sf.write(output_filepath, master_buffer.T, out_sr, subtype="FLOAT")
|
||||
# Gap 13: BWF/INFO chunks (bext + LIST/INFO title/artist/ISRC) —
|
||||
# chen sau khi ghi PCM, loi metadata khong lam hong file audio.
|
||||
if metadata:
|
||||
try:
|
||||
from app.core.wav_bwf import patch_bwf_metadata
|
||||
patch_bwf_metadata(output_filepath, metadata)
|
||||
except Exception as e:
|
||||
logger.warning("[RenderEngine] BWF metadata skipped: %s", e)
|
||||
return output_filepath
|
||||
|
||||
Reference in New Issue
Block a user