Convert MP3 files to Chinese text via Google Cloud API
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:
- Convert MP3 files to FLAC files via SOX
- Convert FLAC files to English text via Google Speech API
- Translate English text to Chinese text via Google Translate API
Installation of related software
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