Files
memind/src/voice/micSession.ts
T
John 2e14873f2d Initial commit: Memind H5 portal with MindSpace, Plaza, and agent jobs.
Track application source and tests; exclude local env, user workspaces, and runtime data via .gitignore.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 15:04:43 -07:00

16 lines
440 B
TypeScript

/** Serialize mic open/close so the second session waits for tracks to release. */
let releaseChain = Promise.resolve();
export function waitForMicRelease() {
return releaseChain;
}
export function extendMicRelease(until: Promise<unknown>) {
let release!: () => void;
const gate = new Promise<void>((resolve) => {
release = resolve;
});
releaseChain = releaseChain.then(() => gate);
void until.finally(() => release());
}