Initial Adaptive Music v0.5.0 release
This commit is contained in:
commit
14f0d8c26b
114 files changed
+6907
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import {readFile,writeFile} from 'node:fs/promises';
|
||||
import {createHash} from 'node:crypto';
|
||||
import {pcmFixtureFrames} from '../gateway/pcm-fixture.mjs';
|
||||
const manifest=JSON.parse(await readFile('.local/synthetic-audio/manifest.json','utf8'));
|
||||
const result={checked_at:new Date().toISOString(),evidence_class:'local generated audio decoding',tracks:0,frames:0,duration_seconds:0,hashes_match:true};
|
||||
for(const tracks of Object.values(manifest.sequences))for(const track of tracks){
|
||||
const bytes=await readFile(`.local/synthetic-audio/${track.file}`);
|
||||
if(createHash('sha256').update(bytes).digest('hex')!==track.sha256)throw Error('fixture mismatch');
|
||||
let frames=0;for(const frame of pcmFixtureFrames(bytes)){if(frame.length!==1920)throw Error('frame mismatch');frames++;}
|
||||
if(frames!==4500)throw Error('duration mismatch');result.tracks++;result.frames+=frames;result.duration_seconds+=frames*.02;
|
||||
}
|
||||
await writeFile('evidence/synthetic-pipeline.json',JSON.stringify(result,null,2)+'\n');console.log(JSON.stringify(result));
|
||||
Reference in new issue
Block a user