Microphone not working


I’m programming an experiment in which the microphone has to activate and deactivate several times during it. But it only activates on the first time. When the 2nd and 3rd times come, the mic won’t work anymore and the experiment crashes.

Here follows a screenshot of how it look until now.

What should I do?