Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(video): cook quality/audio-bitrate reach Import Settings; honest suffix-denied hint

esengine6d07b0426001
diff --git a/desktop/src/project/assetImporter.ts b/desktop/src/project/assetImporter.ts
index edf24ed50..c5cb4c6d9 100644
--- a/desktop/src/project/assetImporter.ts
+++ b/desktop/src/project/assetImporter.ts
@@ -77,6 +77,18 @@ const VIDEO: ImporterFieldSpec[] = [
key: 'muted', label: 'Muted', type: 'bool', default: true, category: 'Video',
tooltip: 'Muted clips can autoplay; unmuted autoplay is blocked until a user gesture.',
},
+ {
+ key: 'quality', label: 'Cook Quality', type: 'number', default: 4, min: 2, max: 31, step: 1,
+ category: 'Video', advanced: true,
+ tooltip: 'MPEG-1 quantizer for targets on the wasm decode path (WeChat): '
+ + '2 = near-lossless (largest file), 31 = smallest. Web targets ship the source untouched.',
+ },
+ {
+ key: 'audioBitrateKbps', label: 'Cook Audio Bitrate', type: 'enum', default: 128,
+ category: 'Video', advanced: true,
+ options: [96, 128, 192].map((n) => ({ label: `${n} kbps`, value: n })),
+ tooltip: 'AAC bitrate for the audio track demuxed at cook (wasm decode path).',
+ },
];
const SCENELIKE: ImporterFieldSpec[] = [
diff --git a/sdk/src/platform/wechat/fs.ts b/sdk/src/platform/wechat/fs.ts
index 8bf940634..6ba532a86 100644
--- a/sdk/src/platform/wechat/fs.ts
+++ b/sdk/src/platform/wechat/fs.ts
@@ -38,7 +38,9 @@ function formatReadError(path: string, errMsg: string): string {
if (isCustomExtension(path)) {
const ext = path.substring(path.lastIndexOf('.'));
return `[ESEngine] Cannot read "${path}": WeChat blocked access to "${ext}" files. `
- + `Add { type: "suffix", value: "${ext}" } to packOptions.include in project.config.json`;
+ + `Add { type: "suffix", value: "${ext}" } to packOptions.include in project.config.json. `
+ + `Some suffixes are denied regardless of packOptions — the exporter restages those `
+ + `as "${ext}.bin" (ktx2/esv already are); re-export if this file predates that.`;
}
return `[ESEngine] Cannot read "${path}": permission denied. Check file is included in WeChat package`;
}