php is a scripting language and therefor inherently slow compared to C or any truely compiled language.
the best bet would be to use php as a GLUE language...
1) have php envoke a sound recorder in a webpage to record the voice
2) have php store that voice file on the server
3) have php envoke through a system() call some other voice recognition program on the server already to process that file.
4) have the voice recognition program return some instructions or just text to php
5) have php then take appropriate action based upon those results. either load a webpage, or start some other program.
i think that your best bet..
if you are just trying to learn about writing voice recognitino software and using php to play with it... then i can't give you any advise then the set_time_limit() function