Update: As I mentioned in the description, I used Godot for this project because UE5 had too much latency between input and audio playback. But I've just learned how to fix this!
By setting Windows/Audio/CallbackBufferSize low enough, this eliminates latency (the default is 1024 but you want something more like 128 for this kind of app).