Install VoiceVox on Raspberry Pi
For enabling text to speech on Raspberry Pi, I setup Voicevox on Raspberry Pi4. I followed instruction on github|voicevox_core.
Install Voicevox-core downloader
As my Rpi 4 is on aarch64(the 64-bit extension of the ARM architecture family), I installed the latest binary with arm64 (voicevox_core-linux-arm64-cpu-0.14.4.zip).
|
|
Install Voicevox-core downloader.
|
|
Output of ./download
is like:
|
|
Use sample code on python
Install pyenv on Raspberry Pi
As the python build is using cp38, I installed python 3.8.16 on pyenv on Raspberry Pi.
Install necessary information:
|
|
Clone pyenv from git repository.
|
|
Add below at ~/.bash_profile
|
|
Check pyenv version
|
|
Install python 3.8.17 on pyenv
Trying to install python 3.8.17 by pyenv install 3.8.17
, I encountered ModuleNotfoundError _ctypes
with missing libffi
and _lzma
with missing _lzma
.
|
|
For resolving this, I needed to install libraries by:
|
|
Then I can run pyenv install 3.8.17
successfully.
Install wheel for voicevox_core
|
|
Setup environment using a downloader.
|
|
At ./example/python
, create run.py
with copying the code at github.
Additional feature for demo
Call external API
I called an API that returns the fortune using Azure Open AI Chat completion API on Azure Functions using requests
package.
Read out ouput wav file
For demoing the voicevox, I use simpleaudio
. For running it, I neede to install libasound2
by:
|
|
Sample code
A sample code example to call external API(Azure Open AI on Azure Function), text to speech by voicevox, and read out the audio.