Here is the source. I always fail to explain very well. Sox.exe and Curl.exe run from the command line, they are not Dark Basic programs. The db program runs a .bat file that runs both of these programs.
do
if file exist("speech.wav")=1
delete file "speech.wav"
endif
if file exist("speech.flac")=1
delete file "speech.flac"
endif
if file exist("output.txt")=1
delete file "output.txt"
endif
print "Press any key to start recording"
wait key
cls
print "recording.....Press any key to stop"
record sound 1
wait key
stop recording sound
print "Recording stopped"
save sound "speech.wav",1
id = EXECUTE executable ("out.bat", "", "")
do
a = file exist("output.txt")
if a = 1 then Exit
loop
open to read 1, "output.txt"
read string 1, find$
b$=first token$(find$,":")
for a = 1 to 4
b$=next token$(":")
next a
b$=first token$(b$,chr$(34))
cls
if b$=""
print "I did not understand you."
else
print b$
endif
close file 1
do
if spacekey()=1
cls
Exit
endif
if returnkey()=1
end
endif
text 0,20,"Press SPACEBAR to retry or ENTER/RETURN to quit"
loop
loop