Speaker command reads aloud the text message. It supports multilingual voice reading

Overview

Build

speaker - Read the text aloud

speaker command reads aloud the text message. It supports multilingual voice reading. If you want the time signal, the speaker can also start reading aloud at a specified time.

The time signal function only work Mac. Linux environment being tested.

Platform

speaker command depends the cron command to implement the time signal function. So, Speaker command only work UNIX(include Mac) / Linux platform. Does not support Windows.

Prerequisite

macOS

speaker command requies AudioToolbox.framework, but this is automatically linked.

Linux

ALSA is required. On Ubuntu or Debian, run this command:

$ sudo apt install libasound2-dev

How to Install

Step.1 Install golang

If you don't install golang in your system, please install Golang first. Check the Go official website for how to install golang.

Step2 Using go install

$ go install github.com/nao1215/speaker/cmd/speaker@latest
$ sudo cp $GOPATH/bin/speaker /usr/local/bin/.

※ Binaries must be present in $ PATH in order to use the speaker command with sudo.
   $GOPATH for root and the general user may be different.

Other method: Using git clone and make

$ git clone https://github.com/nao1215/speaker.git
$ cd speaker
$ make build
$ sudo make install

How to use

Read the text

speaker command reads the text in Japanese by default (Because the author is Japanese).

$ speaker "こんにちは"

For example, if you want to use russian, please execute the speaker command as follows. Supported languages is listed here.

$ speaker --lang="ru" "я хочу есть мороженое"

The speaker command also supports pipes.

$ echo "pipe is supported" | speaker --lang="en"

Create mp3 file

If you want to create the mp3 file instead of reading aloud, execute the following command.

$ speaker --mp3="./output.mp3" "Create mp3 file"

Register time signal

The time signal is registered by writing the information to the cron configuration file.

$ sudo -E speaker -r 17:43 "Register time signal"

Delete time signal

Time signal information is deleted interactively. speaker command display all registered time signals. So, you select one from them, and then speaker command delete it.

$ sudo -E ./speaker -d
[1] 43 17 * * * /home/nao/.go/bin/speaker "テストだよ"
[2] 43 17 * * * /home/nao/.go/bin/speaker "Register time signal"
[3] 00 00 * * * /home/nao/.go/bin/speaker "Sweet Dreams"
[4] 00 06 * * * /home/nao/.go/bin/speaker "Good morning"

Which time signal do you delete [1-4]: 2

Contact

If you would like to send comments such as "find a bug" or "request for additional features" to the developer, please use one of the following contacts.

LICENSE

The speaker project is licensed under the terms of the Apache License 2.0.

You might also like...
Convenient wrappers for reading inputs.

read Convenient wrappers for reading inputs. Examples fmt.Print("input ") line, err := read.Line() if err != nil { panic(err) } fmt.Println(line) Us

textnote is a command line tool for quickly creating and managing daily plain text notes.

textnote is a command line tool for quickly creating and managing daily plain text notes. It is designed for ease of use to encourage the practice of daily, organized note taking. textnote intentionally facilitates only the management (creation, opening, organizing, and consolidated archiving) of notes, following the philosophy that notes are best written in a text editor and not via a CLI.

A command line http test tool. Maintain the case via git and pure text
A command line http test tool. Maintain the case via git and pure text

httptest A command line http test tool Maintain the api test cases via git and pure text We want to test the APIs via http requests and assert the res

colorStyle is a library of styles for command-line text.
colorStyle is a library of styles for command-line text.

colorStyle ColorStyle is a library of styles for command-line text. Used to modify the style of text for standard output to the terminal interface, yo

Display a message in morse code on your capslock LED, keyboard backlight or using your screen brightness!
Display a message in morse code on your capslock LED, keyboard backlight or using your screen brightness!

halp halp is a command line utility that lets you display messages in morse code on your capslock LED, keyboard backlight (if you have it) or using yo

A simple logging interface that supports cross-platform color and concurrency.
A simple logging interface that supports cross-platform color and concurrency.

WLog Package wlog creates simple to use UI structure. The UI is used to simply print to the screen. There a wrappers that will wrap each other to crea

Detects whether a terminal supports colors
Detects whether a terminal supports colors

Termcolor Detects what level of color support your terminal has. This package is heavily inspired by chalk's support-color module. Install go get gith

A flexible commandline tool for template rendering. Supports lots of local and remote datasources.
A flexible commandline tool for template rendering. Supports lots of local and remote datasources.

Read the docs at docs.gomplate.ca, chat with developers and community in the #gomplate channel on Gophers Slack gomplate is a template renderer which

An open-source GitLab command line tool bringing GitLab's cool features to your command line
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Comments
  • [FEAT. REQUEST] built-in speech synthesizer

    [FEAT. REQUEST] built-in speech synthesizer

    Hi!

    Is it possible to use the built-in speech synthesizer? Is it possible to optionally use google-translate synthesizer (default) and others to choose from?

    ありがとうございました

    opened by michail-vestnik 1
  • [BUG] In the Mac, the sound is played by the registered time signal, but not in the Linux.

    [BUG] In the Mac, the sound is played by the registered time signal, but not in the Linux.

    I registered the same time signal on Mac and Linux, and the audio (mp3) is not played only on the Linux.

    • The voice playback function of the speaker command itself is working.
    • I was able to play audio in the background (e.g. $ speaker "test" &)
    • Looking at the cron log, the speaker command call was successful. And there is no error log
    opened by nao1215 0
  • [BUG] Unable to create mp3 file for long sentences

    [BUG] Unable to create mp3 file for long sentences

    When I pass about 10 lines of text to the speaker command via a pipe, it fails to create an mp3 file.

    $ cat too_long_sentence.txt | speaker
    speaker: can not play audio file: mp3: EOF
    

    I'm guessing that text to mp3 will probably fail if it contains a line feed code.

    opened by nao1215 0
Owner
CHIKAMATSU Naohiro
Embedded/Backend(?) software engineer. Love CLI tool for Linux.
CHIKAMATSU Naohiro
Library and command line tool for reading xDSL stats

xDSL Stats Parser This is a library and command line tool for reading basic xDSL stats, as well bitloading, SNR, QLN and Hlog data. It supports many d

Jan Hoffmann 10 Nov 12, 2022
Reads from existing Cloud Providers (reverse Terraform) and generates your infrastructure as code on Terraform configuration

TerraCognita Imports your current Cloud infrastructure to an Infrastructure As Code Terraform configuration (HCL) or/and to a Terraform State. At Cycl

Cycloid 1.4k Dec 30, 2022
Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors.

Chalk Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors. Documentati

null 6 Oct 29, 2022
null 0 Jan 27, 2022
A message based command library for DiscordGo

A simple message command library for DiscordGo, inspired by discord.py.

QuaKe 3 Feb 7, 2022
A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem

COMMIT CLI A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem. And yes, it is bui

Hisam Fahri 1 Feb 9, 2022
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

dasel Dasel (short for data-selector) allows you to query and modify data structures using selector strings. Comparable to jq / yq, but supports JSON,

Tom Wright 3.9k Jan 2, 2023
Command-line tool to customize the official Spotify client. Supports Windows, MacOS and Linux.

Command-line tool to customize the official Spotify client. Supports Windows, MacOS and Linux. Features Change colors whole UI Inject CSS for advanced

null 13.1k Jan 2, 2023
A convenience provider for reading `.env` files in Terraform.

Terraform Provider dotenv This is a convenience provider for Terraform that provides a data source for reading .env files. Using the provider Below is

John Houston 9 Dec 23, 2022
I like reading news but I also like the terminal. I am leaning and practicing my go.

I made an api and didn't know how to use it. Screenshots The initial screen when you first run the app. The screen after you specify an id. This app u

Daniel M. Matongo 2 Jan 14, 2022