DEV Community

Cover image for Voice To Text Using AWS Transcribe With Python
Chirag Lunagariya for BoTreeTechnologies

Posted on

Voice To Text Using AWS Transcribe With Python

Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of Amazon Web services like S3 and EC2.

Amazon Transcribe is an automatic speech recognition (ASR) service that is fully managed and continuously trained that generates accurate transcripts for audio files. It makes it easy for developers to add speech to text capability to their applications. You can analyze audio files stored in Amazon S3 and have the service return a text file of the transcribed speech using the Amazon Transcribe API. Reach out to learn more about the web development agency in New York for the various ways to improve or build the quality of projects and across your company.

  • You need to grant permissions to use the Amazon Transcribe console for the actions shown in the following policy:

1. Initialize Client:

  • To run transcribe job initialize client using boto3 with AWS credentials.

2. Run Transcribe Job:

  • start_transcription_job(**kwargs) it will start an asynchronous job to transcribe speech to text.

  • Required parameters to run transcribe job are TranscriptionJobName, Media, MediaFormat ('mp3'|'mp4'|'wav'|'flac'), LanguageCode ('en-US'|'es-US'|'en-AU'|'fr-CA'|'en-GB'|'de-DE'|'pt-BR'|'fr-FR'|'it-IT').

3. Check Job Status:

  • Due to the asynchronous nature of the transcription job, we need to check the job status. The time taken to run the transcription job is depending on the length and complexity of your recordings.
  • When the transcription job status is completed, the result links to an Amazon S3 presigned URL that contains the transcription in JSON format:

4. Retrieve Text:

  • On complete transcription, the job result contains the transcription in JSON format. Using python library load JSON response and get the text from the result.

Top comments (1)

Collapse
 
sobinf2464 profile image
Sobin Flex

Text to voice download refers to the process of obtaining software or applications that can convert written text into spoken words. These downloads enable users to convert various forms of written content, such as articles, documents, or emails, into audio files. By utilizing text-to-voice download tools, individuals can listen to text-based information instead of reading it, which can be beneficial for those with visual impairments or those who prefer auditory learning. Examples of popular text-to-voice download options include applications like NaturalReader, Balabolka, and Google Text-to-Speech.