音声データを追加する
This commit is contained in:
parent
087d3d3650
commit
339cf8e1fd
@ -1 +1,2 @@
|
||||
matplotlib
|
||||
matplotlib
|
||||
pyttsx3
|
45
voice/README.md
Normal file
45
voice/README.md
Normal file
@ -0,0 +1,45 @@
|
||||
## Install
|
||||
|
||||
```sh
|
||||
pip install pyttsx3
|
||||
```
|
||||
|
||||
## How To Use
|
||||
|
||||
```sh
|
||||
import pyttsx3
|
||||
|
||||
engine = pyttsx3.init()
|
||||
engine.say("Hello, World!")
|
||||
engine.runAndWait()
|
||||
```
|
||||
|
||||
|
||||
日本語音声エンジンのインストール
|
||||
|
||||
```sh
|
||||
apt install -y open-jtalk
|
||||
```
|
||||
|
||||
Open JTalkには、日本語音声ファイルが必要です。
|
||||
日本語音声ファイルをダウンロードする。
|
||||
|
||||
```sh
|
||||
apt install -y open-jtalk-mecab-naist-jdic hts-voice-nitech-jp-atr503-m001
|
||||
```
|
||||
|
||||
ダウンロードした日本語音声ファイルを以下のパスに配置する
|
||||
|
||||
```sh
|
||||
/usr/share/hts-voice/nitech-jp-atr503-m001/nitech_jp_atr503_m001.htsvoice
|
||||
```
|
||||
|
||||
|
||||
```python
|
||||
import pyttsx3
|
||||
|
||||
engine = pyttsx3.init()
|
||||
engine.setProperty('voice', 'japanese')
|
||||
engine.say("こんにちは、世界!")
|
||||
engine.runAndWait()
|
||||
```
|
5
voice/tsx_helloworld.py
Normal file
5
voice/tsx_helloworld.py
Normal file
@ -0,0 +1,5 @@
|
||||
import pyttsx3
|
||||
|
||||
engine = pyttsx3.init()
|
||||
engine.say("Hello, World!")
|
||||
engine.runAndWait()
|
8
voice/tsx_helloworld_jpn.py
Normal file
8
voice/tsx_helloworld_jpn.py
Normal file
@ -0,0 +1,8 @@
|
||||
import pyttsx3
|
||||
|
||||
engine = pyttsx3.init()
|
||||
voices = engine.getProperty('voices')
|
||||
engine.say("こんにちは")
|
||||
engine.runAndWait()
|
||||
engine.say("これはテキストの読み上げ機能です")
|
||||
engine.runAndWait()
|
Loading…
x
Reference in New Issue
Block a user