diff --git a/frontend/src/components/examples/InlineComponentSVGs.tsx b/frontend/src/components/examples/InlineComponentSVGs.tsx index 4b20cded..01486b16 100644 --- a/frontend/src/components/examples/InlineComponentSVGs.tsx +++ b/frontend/src/components/examples/InlineComponentSVGs.tsx @@ -447,7 +447,26 @@ const EPaperGlyph: React.FC = ({ w, h }) => { ); }; +// ── reSpeaker Lite (dual-mic array board) — flat glyph for gallery cards ──── +const RespeakerLite = () => ( + + + + + + + + XU316 + + + ReSpeaker Lite + + +); + export const INLINE_SVGS: Record = { + // Audio front-ends + 'respeaker-lite': { component: RespeakerLite, w: 240, h: 100 }, // BJTs 'wokwi-bjt-2n2222': { component: BjtNpn, w: 72, h: 72 }, 'wokwi-bjt-2n3904': { component: BjtNpn, w: 72, h: 72 }, diff --git a/frontend/src/store/useSimulatorStore.ts b/frontend/src/store/useSimulatorStore.ts index bcbce6cd..28cf5f04 100644 --- a/frontend/src/store/useSimulatorStore.ts +++ b/frontend/src/store/useSimulatorStore.ts @@ -395,6 +395,19 @@ class Esp32BridgeShim { (this.bridge as { attachSyncI2cDevice?: (d: I2CDevice) => void }).attachSyncI2cDevice?.(device); } + /** + * Attach (or clear, with null) the microphone sample source feeding the + * board's I2S RX path: one signed 16-bit sample per call. Same forwarding + * pattern as addI2CDevice — the in-browser JS-engine bridges implement + * setMicrophoneSource (velxio-prod overlay); everywhere else it's a no-op, + * which reads as a silent mic. + */ + setMicrophoneSource(source: (() => number) | null): void { + ( + this.bridge as { setMicrophoneSource?: (s: (() => number) | null) => void } + ).setMicrophoneSource?.(source); + } + /** Remove a previously-registered virtual device. */ removeI2CDevice(addr: number, _bus: 0 | 1 = 0): void { this.i2cBusInstance.removeDevice(addr);