Convert MP3 files to Chinese text via Google Cloud API

March 23, 2018

The goal of this post is to convert MP3 files to multiple Chinese text files in Ubuntu. Google has its well-known speech API and translator API. We focus on the introduction of the setup and the usage of both APIs and other related software. Overall, the procedure is divided into the following steps:

In this post, our OS is Ubuntu. All APIs and software are portable to other platforms as well. Detailed setup for other platforms will not be listed here.

SoX

SoX is known as the Swiss Army knife of sound processing programs. The installation on Ubuntu is simple.

sudo apt-get install sox
sudo apt-get install libsox-fmt-all

The first line installs the package SoX whereas the second line installs the support format, especially MP3 here.

jq

jq is a lightweight and flexible command-line JSON processor. The installation on Ubuntu is simple.

sudo apt-get install jq

The line installs the package jq.

Setup of Google APIs

Google Speech APIs

Google Translate APIs


 

Yingzhou Li

Discussion

I'm a faculty at Fudan University. Follow me on Github and Bitbucket. Hopefully, you will find my code useful. You are also welcome to either email me or post comments below to discuss on these posts.