Google GCP Text-to-Speech Service in one simple binary ;)

Google text-to-speak Simple Binary file

This repository is a simple implementation of google text-to-speak service.
Required enable API in GCP (https://console.cloud.google.com/apis/api/texttospeech.googleapis.com)

Usage

First and only argument is text for speak ;)
You can change behavior of binary by flags:

Option Default Description
credentials-path cloud-proxy Path to credential file from GCP, default GCP cloud proxy auth
output-path output.mp3 Path to output file with mp3 footage
pl false Flag, when would you to use polish language

1. The simplest usage

Generate file output.mp3 in workdir in English with GCP Cloud Proxy Auth:

google-speak "Welcome! How are you?"

2. With polish and custom auth file

Generate file output.mp3 in workdir in Polish with credentials.json auth file.

google-speak -pl -credentials-path credentials.json "Witaj! Co słychać?"

Help message (-h)

Usage of ./google-speak:
  -credentials-path string
        Path to credential file (JSON) (default "cloud-proxy")
  -output-path string
        Output path (mp3 ext required) (default "output.mp3")
  -pl
        Change context to polish language

Installation

Simple pre-compiled version:

  1. Download binary from releases (https://github.com/oxess/google-speak/releases)
  2. Upload to server filesystem scp google-speak server1:/usr/local/bin/google-speak
  3. Make executable chmod +x /usr/local/bin/google-speak

Or:

  1. Download repository git clone https://github.com/oxess/google-speak
  2. Go to directory cd google-speak
  3. Build dependencies go mod download
  4. Compile to binary go build
  5. Move to local filesystem mv google-speak /usr/local/bin/google-speak
  6. Can file execute chmod +x /usr/local/bin/google-speak

How to generate GCP JSON Access Key

  1. Enable text-to-speech API in GCP (https://console.cloud.google.com/apis/api/texttospeech.googleapis.com)
  2. Create new service account (https://console.cloud.google.com/iam-admin/serviceaccounts/create)
  3. Go to detail view of this service account > Keys
  4. Push button "Add key" and "Create new key" and choose "JSON"
  5. Save file on disk
  6. Done!

Attention!
You should secure your key for production version.
Do not using didn't secure key on production!

Owner
Similar Resources

Guess the natural language of a text in Go

guesslanguage This is a Go version of python guess-language. guesslanguage provides a simple way to detect the natural language of unicode string and

Dec 26, 2022

omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser Omniparser is a native Golang ETL parser that ingests input data of various formats (CSV, txt, fixed length/width, XML, EDI/X12/EDIFACT, JS

Jan 4, 2023

Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Tagify Gets STDIN, file or HTTP address as an input and returns a list of most popular words ordered by popularity as an output. More info about what

Dec 19, 2022

Extract urls from text

xurls Extract urls from text using regular expressions. Requires Go 1.13 or later. import "mvdan.cc/xurls/v2" func main() { rxRelaxed := xurls.Relax

Jan 7, 2023

Easy AWK-style text processing in Go

awk Description awk is a package for the Go programming language that provides an AWK-style text processing capability. The package facilitates splitt

Jul 25, 2022

Change the color of console text.

go-colortext package This is a package to change the color of the text and background in the console, working both under Windows and other systems. Un

Oct 26, 2022

Templating system for HTML and other text documents - go implementation

FAQ What is Kasia.go? Kasia.go is a Go implementation of the Kasia templating system. Kasia is primarily designed for HTML, but you can use it for any

Mar 15, 2022

Package sanitize provides functions for sanitizing text in golang strings.

sanitize Package sanitize provides functions to sanitize html and paths with go (golang). FUNCTIONS sanitize.Accents(s string) string Accents replaces

Dec 5, 2022

Small and fast FTS (full text search)

Microfts A small full text indexing and search tool focusing on speed and space. Initial tests seem to indicate that the database takes about twice as

Jul 30, 2022
:book: A Golang library for text processing, including tokenization, part-of-speech tagging, and named-entity extraction.

prose prose is a natural language processing library (English only, at the moment) in pure Go. It supports tokenization, segmentation, part-of-speech

Jan 4, 2023
ByNom is a Go package for parsing byte sequences, suitable for parsing text and binary data

ByNom is a Go package for parsing byte sequences. Its goal is to provide tools to build safe byte parsers without compromising the speed or memo

May 5, 2021
a simple and lightweight terminal text editor written in Go

Simple Text editor written in Golang build go build main.go

Oct 4, 2021
This is a simple text completion/editing/auto-correction tool I created in Go.
This is a simple text completion/editing/auto-correction tool I created in Go.

Auto Text Completion Tool This is a simple text completion/editing/auto-correction tool I created in Go. The tool receives the following arguments: Th

Oct 25, 2022
Simple text-to-ascii-art generator

Simple text-to-ascii-art generator

Nov 17, 2021
Arecibo: Simple text randomizer

Arecibo Arecibo: Simple text randomizer. Transforms This {article|website|newspaper} will give you the {most|best|most accurate} information about thi

Dec 8, 2021
A simple action that looks for multiple regex matches, in a input text, and returns the key of the first found match.

Key Match Action A simple action that looks for multiple regex matches, in a input text, and returns the key of the first found match. TO RUN Add the

Aug 4, 2022
NERV Editor - A simple but peculiar text editor
NERV Editor - A simple but peculiar text editor

nerved a simple but peculiar text editor introduction nerved is a text editor bu

Oct 24, 2022
A general purpose application and library for aligning text.

align A general purpose application that aligns text The focus of this application is to provide a fast, efficient, and useful tool for aligning text.

Sep 27, 2022
Parse placeholder and wildcard text commands

allot allot is a small Golang library to match and parse commands with pre-defined strings. For example use allot to define a list of commands your CL

Nov 24, 2022