Repository navigation
feat: export multi-clip scenes and frame custom voice audio - #44
google-labs-stitch[bot] wants to merge 2 commits into
Conversation
- Export trimmed or multi-clip scenes via verified KD.fetch RPCs - Select ready 4K and 1080p video variants and pin matched variant IDs - List custom voices from cj and lr and download character voice audio - Frame raw 24 kHz PCM responses into 44-byte RIFF/WAVE audio files - Skip expired signed URLs, bypass stale caches, and filter extensions - Update the tool reference guides in English, Chinese, and Japanese
byteland-app
left a comment
There was a problem hiding this comment.
I reproduced an audio corruption case in ts/fetch_media.ts:68–87,219–228. A PCM-marked URL that returns HTTP 200 with application/octet-stream and a JSON error object is returned as an audio/wav file. Reject error payloads before framing and require a positive PCM indication. Cover JSON error bodies, existing WAV, MP3 and AAC streams, and valid raw PCM. Please separate the audio framing from the scene export change for independent verification.
|
Changes requested.
|
- Reject leading JSON or XML error bytes before PCM WAV framing - Verify two MPEG or ADTS frames so FF FF PCM gets a WAV header - Cap sceneExport at 25 polls and 90 s below the 120 s CDP limit - Map GI video resolution codes per build and add quality option - Resolve <sceneId>:<wfId> clips without triggering scene export - Split voice, URL, and matching helpers to keep files small
|
Addressed all six review items in commit
|
|
Closing this pull request. It conflicts with |
Summary
Align
flow_assetsandflow_downloadwith Google Flow front-end buildboq_labs-ai-sandbox-frontend_20261120.00_p0and browser PCM audio framing while keeping the 23-tool MCP surface unchanged:<sceneId>vs<sceneId>:<wfId>ID rule, and bounded Angular RPC export (ts/scene_tiles.ts,ts/scene_export_builds.ts,ts/scene_export.ts,src/asset_matching.rs,src/assets.rs,src/download.rs):<sceneId>(no:) identifies the wholeSCENEtile (kind: "scene"): downloads 1-clip untrimmed scenes directly (Uc[0].primaryMediaId) and exports multi-clip or trimmed scenes throughwindow.__flowMcp.sceneExportusing verifiedKD.fetchdescriptors forGjQLTdandIxdSwd.<sceneId>:<wfId>(with:) identifies clip workflow<wfId>inside scene<sceneId>(kind: "video"): resolves directly to that clip's media without triggering whole-scene export, whilesceneExportrejects:IDs (scene_clip_id_not_scene).sceneExportto25polls and a hard90_000ms (90s) wall-clock deadline (SCENE_EXPORT_BUDGET_MS, 30 s belowcall_flow_async's 120 s timeout insrc/engine.rs) across store binding,GjQLTd, poll delays, andIxdSwdRPCs so slow exports abort cleanly withscene_export_timeoutand stop polling in Chrome.quality(ts/frontend_builds.ts,ts/media_variants.ts,ts/dom.ts,ts/read_store_snapshot.ts,src/assets.rs,src/download.rs,src/service.rs):resolutionLabelFn: "GI"andresolutions: { p360: 4, p720: 1, p1080: 2, p4k: 3 }onNOVEMBER_20_SNAPSHOT.media, consulting numericresolutioncodes only on verified builds (falling back strictly to explicit string labels or pixel dimensions on unverified builds).primaryMediaId("original") by default inreadStoreTiles,pickTileUrl, andflow_download, and expose an optionalqualityparameter ("original","360p","720p","1080p","4k", or"best", with alias"resolution") onflow_download.ts/custom_voices.ts,ts/project_store.ts,ts/dom.ts,ts/read_store_snapshot.ts,src/voices.rs,src/characters.rs,src/download.rs):cjandlrints/custom_voices.tswhile keepinggetTileMap()strictly restricted toybrows, list custom voices underkind: "audio", resolve voice IDs on look-lessCHARACTERtiles, and validate"character"voice downloads as"audio".ts/resolve_video_url.ts,ts/fetch_media.ts,src/media_files.rs,src/download.rs):{,[, or markup/XML (<!doctype,<html,<?xml,<error,<mpd,#extm3u,)]}') in bothts/fetch_media.tsandsrc/media_files.rsso JSON error bodies are never wrapped with a WAV header.0xFFMP3 check inhasKnownMediaContainerwith strict two-frame MPEG Layer II/III and ADTS AAC header verification (hasFramedMpegOrAdtsAudio) plus explicit containerContent-Typechecks so raw 16-bit PCM starting withFF FFalways receives Flow's 44-byteRIFF/WAVEheader (24000Hz, 16-bit mono PCM).src/download_urls.rs,src/asset_matching.rs,src/voices.rs,ts/custom_voices.ts,src/media_files.rs):src/download_urls.rs, asset/clip matching intosrc/asset_matching.rs,list_voicesintosrc/voices.rs, and custom voice helpers intots/custom_voices.ts, keeping every.rsand.tsfile well below the 800-code-line ceiling (src/characters.rs: 687,src/download.rs: 666,src/assets.rs: 568,ts/read_store_snapshot.ts: 666,ts/project_store.ts: 450).ResolveMediaIdwithbypass_cache = true, and enforce a media extension allowlist so opaque path suffixes such as.2asave as<asset_id>.wavor<asset_id>.mp4.docs/en/tools-reference.md,docs/zh-CN/tools-reference.md,docs/ja/tools-reference.md):qualityparameter,<sceneId>vs<sceneId>:<wfId>behavior, scene exports, custom voices, and character voice downloads in English, Simplified Chinese, and Japanese.Verification
cargo xtask ci,cargo xtask collect-licenses,cargo deny --locked --workspace check,RUSTFLAGS="-D warnings" cargo build --release --locked --bin flow-mcp, and liveflow-mcp --headless doctor --jsonwith zero warnings (CI: OK).application/octet-streamresponses with JSON{...}or BOM +[...]rejected in bothfetchMediaandvalidate_downloaded_filewithout adding a WAV headerFF FFframed with a 44-byte24000HzRIFF/WAVEheader while valid two-frame MP3 retains its container bytesflow_downloadpreserves the tile's primary720prendition;quality: "1080p","4k", and"best"select verifiedGIresolution variants<sceneId>downloads 1-clip scenes directly and exports multi-clip/trimmed scenes viaGjQLTd+IxdSwd;<sceneId>:<wfId>downloads individual clips;sceneExportrejects:IDs, halts cleanly at its deadline with zero stray background polls, and returnsunsupported_front_endon unverified builds.2a->.mp4filename allowlist, and expired signed URL refresh all passAutomated PR initiated by user @byteland-app via Stitch Loop.