After checking my code I found why it is taking 7 seconds to load wish is a pain..
$target_path = "uploads/";
exec("./speechdetect.sh uploads/voice.3gp > speech.results");
$myFile = "uploads/voice.3gp";
unlink($myFile);
$myFile = "voice.flac";
unlink($myFile);
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
My script takes a voice recording and then sends it to google via speechdetect.sh. then takes the text which googled translated say to speak and then my program matches it and executes the command accordingly such as radio on.
How can I make this faster better or more efficient I really want a fast page loading time Im also using lighttpd.
P.S without this section of code my page loads in 352ms.
Also the shell code is
#!/bin/bash
sudo rm voice.flac
# FLAC encoded example
ffmpeg -i $1 voice.flac
curl \
--data-binary @voice.flac \
--header 'Content-type: audio/x-flac; rate=8000' \
'https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&pfilter=0&lang=en-GB&maxresults=1'