From sgcWebSockets 2023.5.0 building Real-Time Translators is more easy using OpenAI APIs and Text-To-Speech APIs from Windows, Google or Amazon.
OpenAI translation building applications offer a multitude of advantages. They provide fast and accurate translations across multiple languages, enabling seamless communication and breaking down language barriers. These applications leverage state-of-the-art machine learning algorithms, ensuring high-quality outputs. Moreover, they can be easily integrated into various platforms, making them versatile and accessible for a wide range of users.
To build a Translator with voice commands, the following steps are required:
Create a new Translator, using the default Text-To-Speech from Microsoft Windows. Use Start to Start the recording of the audio and Stop to Stop the recording and send the audio to the OpenAI API and translate it.
1234567891011121314// ... create the translator componentsgcTranslator := TsgcAIOpenAITranslator.Create(nil);sgcTranslator.OpenAIOptions.ApiKey := 'your_openapi_api_key';// ... create audio recorder and tex-to-speechsgcAudioRecorder := TsgcAudioRecorderMCI.Create(nil);sgcTextToSpeech := TsgcTextToSpeechSystem.Create(nil);// ... assign audio components to translatorsgcTranslator.AudioRecorder := sgcAudioRecorder;sgcTranslator.TextToSpeech := sgcTextToSpeech;// ... start the translator, speak with a microphone to capture the audio and stop to translate itsgcTranslator.Start;... speaksgcTranslator.Stop;
Find below the source code of the Translator Application Demo showing the main features of the Real-Time Translator built with the sgcWebSockets library for windows.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.