Skip to content

Instantly share code, notes, and snippets.

@lelinhtinh
Last active September 25, 2019 21:13
Show Gist options
  • Save lelinhtinh/0aa76b214eca0e68549ac7f0027b0781 to your computer and use it in GitHub Desktop.
Save lelinhtinh/0aa76b214eca0e68549ac7f0027b0781 to your computer and use it in GitHub Desktop.

Đọc văn bản Tiếng Việt bằng Google

Cài đặt

sudo apt install sox libsox-fmt-mp3
sudo apt install python3-pip
pip3 install google_speech

Thêm vào PATH

nano ~/.bashrc

Nhập vào:

export PATH=$PATH:~/.local/bin

Lưu và đóng nano.

Cập nhật PATH

source ~/.bashrc

Sử dụng

google_speech -l vi "Bầu trời trong xanh thăm thẳm, không một gợn mây."

Cài đặt

pip install gTTS

Thêm vào PATH

Như trên.

Sử dụng

gtts-cli -l vi "Lửa tắt, anh dõi theo những vì sao qua cửa sổ." | play -t mp3 -

Cài đặt phụ thuộc

sudo apt install xsel libnotify-bin libttspico0 libttspico-utils libttspico-data libwww-perl libwww-mechanize-perl libhtml-tree-perl sox libsox-fmt-mp3

Tải về bản mới nhất

git clone https://github.com/zemog9000/simple-google-tts.git .tts
cd ~/.tts
sudo chmod +x simple_google_tts

Thêm alias

nano ~/.bash_aliases

Nhập vào:

alias tts='~/.tts/simple_google_tts vi '

Lưu và đóng nano.

Cập nhật alias

source ~/.bashrc
source ~/.bash_aliases

Sử dụng

tts "Cảnh tượng trước mắt chúng tôi thực sự hùng vĩ."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment