Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Speech-to-Text Transcription File

jasnel
New Member

I uploaded an mp3 and apparently converted it to text but the resulting file is a json and I want a text file. How do I get this?

0 2 3,542
2 REPLIES 2

Hi @jasnel,

Welcome to Google Cloud Community.

You can open the JSON file output using a text editor application and look for the "transcript" object under "results". The "transcript" value holds the Speech API's text transcription of your audio file, you can then copy that returned values and save it as a text file if it's necessary.

 

{
  "results": [
    {
      "alternatives": [
        {
          "transcript": "See your text transcription here",
          "confidence": 0.98267895
        }
      ]
    }
  ]
}

 

You can also consider using JSON-to-TEXT converters available online like this thread that I found in StackOverflow, how to convert json into plain text in python.

The Speech-to-Text API utilize JSON because it is a file format that is lightweight, structured and is widely supported by many different programming languages and software libraries, it is well organized and lots of application can read and write this file format. This is important for files that contain transcriptions of an audio file because it can be complex and can contain lots of information.

I hope my suggestion helped you.

Usable resource:
- Speech-to-Text V1
- Speech-to-Text V2
- Cloud Speech-to-Text code samples

Hello Jasnel,
Any decent  text to speech AI also allows the reverse i.e. speech to text conversion. In case you are in frequent need of such conversions you shall invest in a good application that helps you extract texts from speech and in whichever language you desire to 'cause the free sources mostly do not yield proper results and full of discrepancies. Just my two cents...