Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr4172 :: Re: hpr4072 Piper voice synthesis

Archer72 demonstrates using the /opt directory for the Piper executables.

<< First, < Previous, , Latest >>

Thumbnail of Archer72
Hosted by Archer72 on 2024-07-30 is flagged as Clean and is released under a CC-BY-SA license.
tts,TextToSpeech,VoiceSynthesis,accessibility. 4.

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:05:15

Accessibility.

Shows about tearing down the barriers for our fellow hackers.

Clone piper and use the /opt directory

mkdir -p /opt/bin/piper/
sudo chown -R user /opt/bin/piper/
sudo apt install cmake
git clone https://github.com/rhasspy/piper.git
cd piper/
make
cp install/piper* /opt/bin/piper/
cp install/lib* /opt/bin/piper/
exec /opt/bin/piper/piper

Voices

sudo apt install git-lfs
git lfs install
git clone https://huggingface.co/rhasspy/piper-voices
cd piper-voices

Test voice

echo 'This sentence is spoken first. This sentence is synthesized while the first sentence is spoken.' |\
    exec /opt/bin/piper/piper \
    --model ~/git/piper-voices/en/en_GB/southern_english_female/low/en_GB-southern_english_female-low.onnx \
    --output voice.wav

Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2024-07-24 14:04:27 by Ken Fallon

Fails on Fedora 40

[ 22%] Linking C shared library libespeak-ng.so /usr/bin/ld: ../ucd-tools/libucd.a(case.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status [snip] make: *** [Makefile:5: all] Error 2
Comment #2 posted on 2024-07-26 09:38:17 by Archer72

Re:Fails on Fedora 40

Hi Ken, I get the same failure, and found that there was a release in 2023 github com/rhasspy/piper/releases/tag/2023.11.14-2 I put the downloaded piper directory in /opt, along with the piper-voices/en directory and have a successful voice output. uname -r 6.9.5-200.fc40.x86_64 [piper] [info] Loaded voice in 0.33 second(s) [piper] [info] Initialized piper Output directory: /home/mark/./1721984513770506807.wav
Comment #3 posted on 2024-08-01 14:18:43 by Ken Fallon

More issues

I tried it and unfortunately it continues to fail. terminate called after throwing an instance of 'std::runtime_error' what(): Model file doesn't exist Aborted (core dumped)
Comment #4 posted on 2024-08-02 13:01:09 by Ken Fallon

It works

Thanks to advice from Archer72 on our Matrix channel. You need to tell where the voices are kept. echo 'This sentence is spoken first. This sentence is synthesized while the first sentence is spoken.' | exec /opt/bin/piper/piper --model /opt/bin/piper/piper-voices/en/en_GB/southern_english_female/low/en_GB-southern_english_female-low.onnx --output voice.wav

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the P in HPR stand for ?