- Detecting the language of the text.
- Selecting the TTS Voice.
- Converting Speech to Text (Up to 1 minute long)
- Google cloud speech
- Google trans new
- Yuval Mejahez for creating pyttsreverso. Be sure you are running version 0.3
The TTS (Text to Speech) feature is free thanks to Reverso Translations, But the Speech To Text feature requires an active google API cloud account with an enabled billing account (pricing table can be found here).
To use Google Speech Recognition, we need to create Google Application and enable the API. Here are the steps you need to follow to integrate your program with the Google Speech-To-Text API.
The first thing you need to access Google APIs is a Google account and create a Google application. You can create a google application using the google console: Go to google console.
Once you open the google console, click on the dropdown at the top. This dropdown displays your existing google application. After clicking, a pop-up will appear, then click on “New Project.”
Then enter your application name and click on Create.
Once you have created your google application, you need to grant your application access to the “Google Cloud Speech-To-Text” API. To do so, go to the application dashboard and, from there, go to the APIs overview. See below how to access it:
Click on “Enable Apis and Service,” and then search by “speech,” then all Google APIs to do with text will be listed.
And then click “Enable.” Once enabled, you will grant permissions to your application to access the “Google Cloud Speech to Text API.”
The next step is Downloading your Google credentials. The credentials are necessary so Google can authenticate your application, and therefore Google knows that their API is being accessed by you. They can measure how much you are using their APIs and charge you if the consumption passes the free threshold.
Here are the steps to download the google credentials. First, from the home dashboard, get to “Go to APIs overview,” just like before, and on the left-hand side menu, click on credentials.
Then click on “Create Credentials” and create a “Service Account.”
Enter any service account name you like, and click Create. Optional, you can grant service account access to the project and click Done.
Now click on the service account you just created. The last click will take you to the service account details.
Go to the “Keys” section and click on “Add Key” and “Create New Key,” which will create a new key. This key is associated with your application through the service account.
Select JSON and click on Create in the pop-up, which will download a JSON file containing the key to your machine. Please note where you save this file since you will need it next.
version: "3.7" services: tts-stt: image: techblog/tts-stt:latest ports: - "8080:8080" container_name: tts-stt labels: - "com.ouroboros.enable=true" networks: - default volumes: - ./ttstt/keys/key-file.json:/opt/ttstt/keys/key-file.json - /etc/localtime:/etc/localtime:ro restart: unless-stopped
“key-file.json” name is mandatory (you can’t change it). This is the key file you have created and downloaded in step 3.
docker-copmose up -d to pull and run your container. Open your browser and navigate to your container IP address with port 8080. You should see the following screen.