import type {Worker} from './types'; interface Audio { step: number; wallTime: number; } const worker: Worker = async io => { const components = await io.getData('/components'); if (!components.includes('audio')) { return; } const tagsMap = await io.save>('/audio/tags'); for (const [run, tags] of Object.entries(tagsMap)) { for (const tag of tags) { const list = await io.save('/audio/list', {run, tag}); for (const [index, audio] of Object.entries(list)) { await io.saveBinary('/audio/audio', {run, tag, index, ts: audio.wallTime}); } } } }; export default worker;