Hello and Welcome to a new eSeGeCe e-learning session. Today we will show how to create a Real-Time Translation Application in Delphi using the OpenAI API and how to convert the response to Voice.
First we create a new form with 2 buttons and 1 memo. Then we drop a Translator component which encapsulates the Translation API which will be used to interactuate with OpenAI. The Translator requires to set the OpenAI Api Key, which can be obtained from the OpenAI Servers. We drop 3 additional components, an Audio Recorder component that it's used to capture the microphone audio and create a wave file which will be sent to OpenAI; an Amazon Text To Speech component that converts text to audio and finally and audio player to play the mp3 file returned by Amazon Polly API.
Then, we handle the Translator events to know when the audio is recording and when is stopped. OnTranslation event returns the text translated when using our own voice in another language different from English.
Now, we compile the application and we show a simple example where we say "Hola, Buenos días, como estás?" in spanish and we get the translation in English.
Смотрите видео Delphi Real-Time Translator AI онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал eSeGeCe 02 Июнь 2023. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 803 раз и оно понравилось like посетителям.