Add the audio
In your enemy scene node tree with the root node selected click the "+" and select "AudioStreamPlayer2D" (or 3D as appropriate) and drag your audio file into the "stream" on the right. Name the node.
Make one of these for each sound.
Add a script
Right click on the enemy root node and click "attach script".
var is_speaking = false
if phrase == 0:
elif phrase == 1:
is_speaking = true
You'll need to call the
speak method on whatever criteria you want. You might also want to add a timer node with a signal to reset
is_speaking. Hopefully that puts you on the right lines.