Convert Hindi Speech to Text Using Assembly AI's API
Learn how to transcribe Hindi audio to text with Assembly AI's API. Access API keys, set up using Python SDK, and export subtitles easily.
File
Convert Hindi Speech to Text (Python Tutorial)
Added on 01/29/2025
Speakers
add Add new speaker

Speaker 1: Hi, everyone, I'm Smitha from Assembly AI. And in today's video, I'm going to show you how we can convert Hindi speech into text using Assembly AI's speech-to-text API. The very first thing we want to do is head on over to Assembly AI's website and get a free API key. So you can do that by signing up for the API and enter your details right here. Since I already have an account, I'm just going to log in. Once you're inside of your account, you should be able to see your API token right here. And you can easily copy it and paste it elsewhere. Since this example is in Python, we are going to be downloading Assembly AI's Python SDK. And we can easily do that by going into Terminal and typing in pip install assembly AI. Next, I'm heading into Visual Studio Code. And I just have a Python file open. And this is where I'm going to start writing some code. So the first thing we want to do is import the Python library that we just downloaded. So import assembly AI as AAI. Next, we want to define our API key. So we'll do aai.settings.apikey equals to. And then right here is where you paste your API key. Once we've done that, let's define our audio URL. So audio URL equals to. I have downloaded this Hindi audio that I want to transcribe. So I'm just going to copy its relative path and paste it right here. Once we've done that, we want to define some config parameters. In our instance, since we're transcribing Hindi data, what we have to define is the language. So let's do config equals aai.transcriptionconfig equals to language code equals to hi. Assembly AI supports over 20 different languages. And you can find the language code for each of those supported languages in this table right here in the documentation. I'll be linking this in the description box if you're interested. Once we've defined our transcription config, we want to set up our transcriber object. So let's do a transcriber equals to aai.transcriber and define our config. Once we've done that, we can now get our transcript. So let's do transcript equals to transcriber.transcribe. And the input for the transcribe function will be the audio URL that we have created earlier. And lastly, what I want to do is I want to write out our transcript into this response.txt file that I created so it's easier to store our transcript. So to do that, we're going to do with open response.txt f.write transcript.txt. So transcript.txt contains the entire text of the transcript returned from Assembly AI's API. And with this method right here, what we're doing is we're writing it out into response.txt. Once you have all this, let's hit Run. Once our script has completed running, we can click on that response.txt file. This right here is the transcription of Hindi speech to text from Assembly AI's API. Now, there's so many other functions that you can do on top of this. For instance, what we can do next is get the subtitles of this file. So we can do that by doing f.write and then transcript.exportSubtitles. And there's two options for the file type, either VTT or SRT. I'm just going to go with VTT. And this is how you do it. This is also going to be written into our response.txt file. Save this and hit Run. Once it has finished running, you can head on over to response.txt. And right below our transcript, we also get to see the VTT subtitles with the timestamps as well. So this is really cool. And there's so many more applications that you can build on top of this. To find out more about what type of features are available with the Hindi language, check out the documentation of Assembly AI's API. And I'll be linking this in the description box below. Let us know what you thought about this video in the comments section below. And if you want to transcribe speech to text in Node.js, check out this video right here.

ai AI Insights
Summary

Generate a brief summary highlighting the main points of the transcript.

Generate
Title

Generate a concise and relevant title for the transcript based on the main themes and content discussed.

Generate
Keywords

Identify and highlight the key words or phrases most relevant to the content of the transcript.

Generate
Enter your query
Sentiments

Analyze the emotional tone of the transcript to determine whether the sentiment is positive, negative, or neutral.

Generate
Quizzes

Create interactive quizzes based on the content of the transcript to test comprehension or engage users.

Generate
{{ secondsToHumanTime(time) }}
Back
Forward
{{ Math.round(speed * 100) / 100 }}x
{{ secondsToHumanTime(duration) }}
close
New speaker
Add speaker
close
Edit speaker
Save changes
close
Share Transcript