The variables are in the same text string as the character text, this makes sense to let the user pick whatever, but for the audio mod, I have to define them or skip them completely. You can take a look at my Python implementation (source code.zip).
My simple way of doing this was something like this: "dialogue = dialogue.replace('[mcs.jerry.name]', 'jerry')." before passing to the API, I have defined ~30 clearly there are more. I have yet to find some time to complete it, at least with the voices at hand.
.Feel free to experiment with this, (or anyone really)