gmn / nanotts Goto Github PK
View Code? Open in Web Editor NEWImproved SVOX PicoTTS speech synthesizer
License: Apache License 2.0
Improved SVOX PicoTTS speech synthesizer
License: Apache License 2.0
I have some users of the Voco add-on for the Mozilla WebThings Gateway, which uses NanoTTS, which are reporting a PCM error that I am unable to reproduce on my own Pi 4.
2020-05-06 21:27:36.677 ERROR : voco: error: opening pcm device failed No such file or directory
2020-05-06 21:27:36.679 ERROR : voco: nanotts: pcm.c:736: snd_pcm_stream: Assertion `pcm' failed.
(note the two different quotation marks by the way)
This is on a Pi 4. Perhaps they are using USB audio output hardware.
This is the code that calls NanoTTS:
def speak(self, voice_message="",site_id="default"):
try:
# TODO add an environment variable here to set alsa to the USB output device?
my_env = os.environ.copy()
my_env["ALSA_CARD"] = str(self.playback_card_id)
ps = subprocess.Popen(('echo', str(voice_message)), stdout=subprocess.PIPE)
output = subprocess.check_output((str(os.path.join(self.snips_path,'nanotts')), '-l',str(os.path.join(self.snips_path,'lang')),'-v',str(self.voice),'--speed','0.9','--pitch','1.2','-p'), stdin=ps.stdout, env=my_env)
ps.wait()
except Exception as ex:
print("Error speaking: " + str(ex))
So it could be that they are using USB audio output devices, and the environment variables aren't set properly for that case.
I noticed there was a way of compiling NanoTTS without ALSA. Would that perhaps make it more universal/robust/agnostic?
First of all I wanted to thank you for your work. NanoTTS has been great.
A question I have is: are there other voices to be found? Specifically, other accents or male voices. Or is this just a matter of changing the pitch?
Hi Gregory,
thanks for creatung nanotts. I believe I just made it available for its first linux distribution via the unofficial arch linux aur archive.
https://aur.archlinux.org/packages/nanotts-git/
Carlo
when issuing command from commandline, if -o option is last, filename is used as spoken text.
nanotts -w "hello" -o 1.wav produces "one dot wave" in the audio file.
nanotts -o 1.wav -w "hello" produces "hello" in the 1.wav audio file, which is what is expected.
Hi!
Have you considered to release this fork under android?
Would be perfect to release it on F-Droid (Free and opensource market/store app).
PicoTTS on AOSP is dead, so it will be very good to have your fork on new Android version.
Cheers,
Paolo
Could someone upload an example here please?
i just made a gui... https://github.com/Intika-Linux-Apps/gSpeech have a look ;)
I use docker to grab and build nanotts along with a few other bits and pieces for a project written in python. This project had originally been written and compiled in a docker container a few years ago.
A few days ago, I had reason to run the build process again, only to find that the wonderful nanotts had broken, switches changed (w to i) and segmentation faults whenever utilised. The switch of spoken words from -w to -i was easy to deal with, but the segmentation faults survived.
Running nanotts from a command prompt seemed to be fine. Within the python program I used:-
subprocess.Popen(nanotts_command, shell=True, stdout=subprocess.PIPE).stdout.read()
This now always causes a:-
Segmentation fault (core dumped)
Running it by hand from a python command line seems to work, just not within the program. Something has changed to prevent the latest version from functioning as the old one did.
I managed to get it working by going to the previous version https://github.com/gmn/nanotts/tree/e3165556ec2ab26b4f42fe9eab652006704aefd0 and wonder if pegging the urls in the readme for major changes could save some headaches for one or two people in future.
Thanks for your work on nanotts, I get verbal alerts about various things everyday as a result of your efforts.
Trying to talk to nanotts from Node.JS i get an error regardless of how I format the command string:
exec("nanotts -c -i \"hello\"", function (err, stdout, stderr) {
...
});
Error: Command failed: nanotts -c -i "hello"
**error: multiple inputs
exec("nanotts -c -i hello", function (err, stdout, stderr) {
...
});
Error: Command failed: nanotts -c -i hello
**error: multiple inputs
exec("nanotts -c hello", function (err, stdout, stderr) {
...
});
Error: Command failed: nanotts -c hello
**error: trailing commandline arguments
exec("nanotts hello", function (err, stdout, stderr) {
...
});
Error: Command failed: nanotts hello
**error: trailing commandline arguments
exec("nanotts -i \"hello\" -c", function (err, stdout, stderr) {
...
});
Error: Command failed: nanotts hello
**error: trailing commandline arguments
exec("nanotts -i 'hello' -c", function (err, stdout, stderr) {
...
});
Error: Command failed: nanotts -i 'hello' -c
**error: multiple inputs
How should I format my command line to avoid this?
If make
fails with
fatal error: alsa/asoundlib.h: No such file or directory
use make noalsa
instead. (yes, that's in the readme already)
make
issues many warnings
warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
editing the Makefile
to read
CFLAGS = -Wall -Wregister
fixed the warnings.
Hello gmn,
First of all I think that this is a really great project.
Is it possible to load pil files. I own the linguatec voice reader based on SVOX. The included voice should be Petra (German).
I have a gl0co0d22_0.pil which seems to be the voicefile
and a svox.pil that I identified as Lingwarefile.
The normal name of the file should probably be svox-gl0co0de-DE22.pil. So at the moment I do not know why I have 2 files.
best regards
Icntaann
g++ -D_PICO_LANG_DIR="/usr/share/pico/lang/" -I. -I./svoxpico -Wall -g -O2 -c src/mmfile.cpp -o objs/mmfile.o
g++ -D_PICO_LANG_DIR="/usr/share/pico/lang/" -I. -I./svoxpico -Wall -g -O2 -c src/nanotts.cpp -o objs/nanotts.o
src/nanotts.cpp:32:19: fatal error: ao/ao.h: No such file or directory
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.