Cyborgscode / Personal-Voice-Assistent

Building a fully featured and localized voice assistant for Linux
146 stars 6 forks source link

How to install on non Fedora distros? #22

Open beew opened 1 year ago

beew commented 1 year ago

Hi, this look very interesting. I am looking for documentations to install from source on non Fedora distros but can't find any. I am using Ubuntu.

Thanks.

Cyborgscode commented 1 year ago

All steps described in the manual install are the same for all distros, just the names for additional packages i.e. mbrola, gtts etc. if or if not available in a specific distro, differ from distro to distro.

Basically you download the Master.ZIP file down, thats the GREEN "<> CODE" button in the code tab. You unpack it. You move the content in ETC and USR to those directories according to the given directory structure. You install the needed packages for python3, pip3, portaudio ( python ), mbrola (from github if needed => use piper instead!!! ), espeak ( needed for most TTS systems, vosk+sounddevice ( via pip3 ), sox , openssl, dbus-tools, JAVA 8+ and the python3-pyaudio package and find the needed language model on https://alphacephei.com/vosk/models

For details see the individual install hints in the README.md . Just work your way from top to bottom in that readme.

It's really straight forward and just one small step each. MBOLA is a bit more complex, but it's optional and Piper or GTTS as much, much better TTS-Systems.

When you have all files in position, you run the compile.sh inside /usr/share/pva and the required java classes are created. Now you are ready to start it ( not as root, as user! ) . I suggest to start it via the desktop entry in you menu as any other app you start. This makes it easy to autostart it later.

it should like this in the end:

/etc/pva
└── conf.d
    ├── 00-test.conf
    ├── 01-default.conf
    ├── 02-number-deutsch.conf
    ├── 50-plugin-cluster.conf
    ├── 50-plugin-diskfree.conf
    ├── 50-plugin-loadtask.conf
    ├── 50-plugin-netflix.conf
    └── 51-plugin-netflix-kiosk.conf

/usr/share/pva/
├── com
│   └── mpatric
│       ├── mit-license.txt
│       ├── mp3agic
│       │   ├── AbstractID3v2FrameData.class
│       │   ├── AbstractID3v2FrameData.java
│       │   ├── AbstractID3v2Tag.class
│       │   ├── AbstractID3v2Tag.java
│       │   ├── BaseException.class
│       │   ├── BaseException.java
│       │   ├── BufferTools.class
│       │   ├── BufferTools.java
│       │   ├── ByteBufferUtils.class
│       │   ├── ByteBufferUtils.java
│       │   ├── EncodedText.class
│       │   ├── EncodedText.java
│       │   ├── FileWrapper.class
│       │   ├── FileWrapper.java
│       │   ├── ID3v1.class
│       │   ├── ID3v1Genres.class
│       │   ├── ID3v1Genres.java
│       │   ├── ID3v1.java
│       │   ├── ID3v1Tag.class
│       │   ├── ID3v1Tag.java
│       │   ├── ID3v22Tag.class
│       │   ├── ID3v22Tag.java
│       │   ├── ID3v23Tag.class
│       │   ├── ID3v23Tag.java
│       │   ├── ID3v24Frame.class
│       │   ├── ID3v24Frame.java
│       │   ├── ID3v24Tag.class
│       │   ├── ID3v24Tag.java
│       │   ├── ID3v2ChapterFrameData.class
│       │   ├── ID3v2ChapterFrameData.java
│       │   ├── ID3v2ChapterTOCFrameData.class
│       │   ├── ID3v2ChapterTOCFrameData.java
│       │   ├── ID3v2.class
│       │   ├── ID3v2CommentFrameData.class
│       │   ├── ID3v2CommentFrameData.java
│       │   ├── ID3v2Frame.class
│       │   ├── ID3v2Frame.java
│       │   ├── ID3v2FrameSet.class
│       │   ├── ID3v2FrameSet.java
│       │   ├── ID3v2.java
│       │   ├── ID3v2ObseleteFrame.class
│       │   ├── ID3v2ObseleteFrame.java
│       │   ├── ID3v2ObseletePictureFrameData.class
│       │   ├── ID3v2ObseletePictureFrameData.java
│       │   ├── ID3v2PictureFrameData.class
│       │   ├── ID3v2PictureFrameData.java
│       │   ├── ID3v2PopmFrameData.class
│       │   ├── ID3v2PopmFrameData.java
│       │   ├── ID3v2TagFactory.class
│       │   ├── ID3v2TagFactory.java
│       │   ├── ID3v2TextFrameData.class
│       │   ├── ID3v2TextFrameData.java
│       │   ├── ID3v2UrlFrameData.class
│       │   ├── ID3v2UrlFrameData.java
│       │   ├── ID3v2WWWFrameData.class
│       │   ├── ID3v2WWWFrameData.java
│       │   ├── ID3Wrapper.java
│       │   ├── InvalidDataException.class
│       │   ├── InvalidDataException.java
│       │   ├── Mp3File.class
│       │   ├── Mp3File.java
│       │   ├── MpegFrame.class
│       │   ├── MpegFrame.java
│       │   ├── MutableInteger.class
│       │   ├── MutableInteger.java
│       │   ├── NoSuchTagException.class
│       │   ├── NoSuchTagException.java
│       │   ├── NotSupportedException.class
│       │   ├── NotSupportedException.java
│       │   ├── UnsupportedTagException.class
│       │   ├── UnsupportedTagException.java
│       │   └── Version.java
│       └── readme.html
├── compile.sh
├── data
│   ├── Command.class
│   ├── Command.java
│   ├── Contact.class
│   ├── Contact.java
│   ├── Contact.java~
│   ├── MailboxData.class
│   └── MailboxData.java
├── hash
│   ├── NumericTreeSort.class
│   ├── NumericTreeSort.java
│   ├── NumericTreeSort.java~
│   ├── StringHash.class
│   ├── StringHash.java
│   ├── ThreeKeyHash.class
│   ├── ThreeKeyHash.java
│   ├── TreeSort.class
│   ├── TreeSort.java
│   ├── TreeSort.java~
│   ├── TwoKeyHash.class
│   └── TwoKeyHash.java
├── io
│   ├── Dos.class
│   ├── Dos.java
│   ├── Dos.java~
│   ├── Executeable.class
│   ├── Executeable.java
│   ├── Executeable.java~
│   ├── MailConnection.class
│   └── MailConnection.java
├── lib
│   ├── javax.activation-1.2.0.jar
│   └── javax.mail-1.6.2.jar
├── model -> vosk-model-de-0.21
├── newloop.py
├── plugins
│   ├── files
│   │   ├── activatewindow.sh
│   │   ├── Cluster.class
│   │   ├── Cluster.java
│   │   ├── DiskFree.class
│   │   ├── DiskFree.java
│   │   ├── LoadTask.class
│   │   ├── LoadTask.java
│   │   ├── Netflix.class
│   │   ├── Netflix.java
│   │   ├── Netflix$Position.class
│   │   ├── SpeechGuard.class
│   │   └── SpeechGuard.java
│   ├── NewClassLoader.class
│   ├── NewClassLoader.java
│   ├── Plugin.class
│   ├── PluginInterface.class
│   ├── PluginInterface.java
│   ├── Plugin.java
│   ├── Plugins.class
│   └── Plugins.java
├── pva
├── pva.conf.default
├── pva.py
├── pvatrayicon.py
├── README.md
├── README.txt
├── server
│   ├── AppResult.class
│   ├── IMAPConnection.class
│   ├── IMAPTask$1.class
│   ├── IMAPTask$2.class
│   ├── IMAPTask.class
│   ├── IMAPTask.java
│   ├── LoadTask.class
│   ├── LoadTask.java
│   ├── MetacacheTask.class
│   ├── MetacacheTask.java
│   ├── PVA$AnalyseMP3.class
│   ├── PVA.class
│   ├── PVA.java
│   ├── Reaction.class
│   ├── SearchTask.class
│   ├── SearchTask.java
│   ├── Server.class
│   ├── Server.java
│   ├── streaming
│   │   ├── DesktopStreaming.class
│   │   ├── DesktopStreaming.java
│   │   ├── LiveStreaming.class
│   │   ├── LiveStreaming.java
│   │   ├── Streaming.class
│   │   ├── Streaming.java
│   │   ├── VideoStreaming.class
│   │   └── VideoStreaming.java
│   ├── TimerTask.class
│   └── TimerTask.java
├── shutdown.sh
├── start.sh
├── test.py
├── timer.sh
├── utils
│   ├── Tools.class
│   └── Tools.java
├── vosk-model-de-0.21
│   ├── am
│   │   ├── final.mdl
│   │   ├── frame_subsampling_factor
│   │   └── tree
│   ├── conf
│   │   ├── mfcc.conf
│   │   └── model.conf
│   ├── graph
│   │   ├── disambig_tid.int
│   │   ├── HCLG.fst
│   │   ├── num_pdfs
│   │   ├── phones
│   │   │   ├── align_lexicon.int
│   │   │   ├── align_lexicon.txt
│   │   │   ├── disambig.int
│   │   │   ├── disambig.txt
│   │   │   ├── optional_silence.csl
│   │   │   ├── optional_silence.int
│   │   │   ├── optional_silence.txt
│   │   │   ├── silence.csl
│   │   │   ├── word_boundary.int
│   │   │   └── word_boundary.txt
│   │   ├── phones.txt
│   │   └── words.txt
│   ├── ivector
│   │   ├── final.dubm
│   │   ├── final.ie
│   │   ├── final.mat
│   │   ├── global_cmvn.stats
│   │   ├── online_cmvn.conf
│   │   └── splice.conf
│   ├── README
│   ├── rescore
│   │   ├── G.carpa
│   │   └── G.fst
│   └── rnnlm
│       ├── feat_embedding.final.mat
│       ├── final.raw
│       ├── special_symbol_opts.conf
│       └── word_feats.txt
└── vosk-model-small-en-us-0.15
    ├── am
    │   └── final.mdl
    ├── conf
    │   ├── mfcc.conf
    │   └── model.conf
    ├── graph
    │   ├── disambig_tid.int
    │   ├── Gr.fst
    │   ├── HCLr.fst
    │   └── phones
    │       └── word_boundary.int
    ├── ivector
    │   ├── final.dubm
    │   ├── final.ie
    │   ├── final.mat
    │   ├── global_cmvn.stats
    │   ├── online_cmvn.conf
    │   └── splice.conf
    └── README

/usr/local/sbin/
├── ai.py
├── chatgpt
├── gsay
├── larynxtts
├── marytts
├── msay
├── piper
├── psay
├── robotsay
├── samsungtts
└── say

Keep in mind, that you do not need every TTS system, but the one you wanne use, needs to work and be configured as "say" command in the config, otherwise you won't hear an answere.

For tests, run "pva" inside /usr/share/pva as you desktopuser in a terminal.

A manual stop will result in bound serverports and you need to kill python and java processes manually!

Watch the log in ~/.var/log/ if something goes wrong, as you will see any output there.

you can manually send sentences to the server by using openssl :

echo 'keyword text' | openssl s_client -connect 127.0.0.1:39999 -nbio

If the java process is running and bound to port 39999 ( check with netstat -lnap|grep java ) you will get a reaction in the log, even it's gets ignored :

"Nicht für mich gedacht:was auch immer hier steht" -> means -> "not for me: what ever you send"

If you see your text but "Nicht für mich gedacht" , you forgot to use the configured keyword :D

If the STS system ( vosk ) is running ( check this with "pavucontrol" -> record tab ) , and you do not get any recognized words in the pva logfile, the sound input level may be to low OR it's the wrong device it listens too.

If you use something besides german, you need to translate the commands before you start, or nothing will happen, when you speak to it ;) But you can store all your translations & changes in your ~/.config/pva/conf.d/ directory , so you don't need to be root to change the config.

beew commented 1 year ago

Thanks! Will try it out.