// speech-voice-demo.el - LIVE VOICE LOOP (stand-in test). Capture -> voiceprint // -> reshape -> INGEST AS GEOMETRY -> read the target back FROM geometry -> the // EL projector renders a line reaching for that voice. Stand-in "Will" = the // voiceprint of imitation.wav. HONEST: pitch + coarse vocal-tract scale, NOT a clone. fn main() { let outdir: String = "/Users/will/Development/neuron-technologies/foundation/el/.claude/worktrees/agent-acc02900ef4ade35e/elp/tests/examples/out/" let vp: String = "/private/tmp/claude-501/-Users-will/6531446d-bc27-4095-930b-e04777c3db4f/scratchpad/will-voiceprint.json" // 1+2: reshape voiceprint JSON -> organ voice-signature source let sig0: [String] = native_list_empty() let sig: [Int] = reshape_voiceprint(vp, "elp/data/will-voice.json") // 3: ingest as geometry + engram_save a reloadable manifold file let ig: Int = ingest_voice(sig, "elp/data/will-voice.engram.json") // 4: READ the target back FROM geometry (engram_load + scan + filter) let g: [Int] = load_voice("elp/data/will-voice.engram.json") println("[voice-geometry] read from manifold: f0=" + int_to_str(native_list_get(g, 0)) + " f0_end=" + int_to_str(native_list_get(g, 1)) + " kf=" + int_to_str(native_list_get(g, 2)) + " f1=" + int_to_str(native_list_get(g, 3)) + " f2=" + int_to_str(native_list_get(g, 4)) + " f3=" + int_to_str(native_list_get(g, 5)) + " (measured, COARSE — not a clone)") // phoneme geometry from the organ (loaded AFTER the voice sig is cached in EL) let pmap: [String] = organ_pmap("elp/data/phonetics-formants.engram.json") let lmap: [String] = organ_lex("elp/data/lexicon.psv") // 5: render a line FROM MEANING in Will's voice let vw: [String] = voice_will(native_list_get(g, 0), native_list_get(g, 1), native_list_get(g, 2)) let t: String = sem_realize(sem_frame("greet", "Will", "", "")) let codes: [String] = text_phonemes(lmap, t) println("[render] \"" + t + "\" :: " + list_join(codes, " ") + " in voice=will f0=" + int_to_str(voice_get_int(vw, "f0")) + " kf=" + int_to_str(voice_get_int(vw, "kf"))) let samples: [Int] = synth_codes(codes, vw, pmap) let ok: Bool = write_wav(samples, 16000, outdir + "will-reply.wav") println("[done] will-reply.wav=" + bool_to_str(ok)) }