Hola tengo este script en python :
Código:
# voz_module.py
import speech_recognition as sr
import json
def reconocer_voz():
"""
Retorna un JSON con:
{ "texto": "hola", "error": "" }
"""
r = sr.Recognizer()
r.pause_threshold = 2.5
try:
with sr.Microphone() as source:
audio = r.listen(source, timeout=10, phrase_time_limit=20)
texto = r.recognize_google(audio, language="es-ES")
return json.dumps({"texto": texto, "error": ""})
except sr.WaitTimeoutError:
return json.dumps({"texto": "", "error": "NO_VOZ"})
except sr.UnknownValueError:
return json.dumps({"texto": "", "error": "NO_ENTENDIDO"})
except sr.RequestError:
return json.dumps({"texto": "", "error": "ERROR_RED"})
except Exception as e:
return json.dumps({"texto": "", "error": "EXCEPCION"})
# Para pruebas locales
if __name__ == "__main__":
print(reconocer_voz())
quisiera ejecutralo en python4delphi desde delphi 12.3 pero que cuando distribulla la aplicacion .exe el cliente no tenga que tener instalado el python esto es posible ?