Googletrans Python library to implement the Google Translate API.
Get Started
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for a free account and get your API key from your dashboard.Step-by-Step Instructions
Install the relevant packages.- AssemblyAI SDK
- Googletrans
assemblyai package and set the API key. Import Translator class from googletrans package.
Transcriber object.
Translator object.
transcribe method and pass in the audio file’s path as a parameter. The transcribe method saves the results of the transcription to the Transcriber object’s transcript attribute.
export_subtitles_srt method. Create a subtitle_transcript variable to translate in the next step.