이 저장소에는 SUSI.AI 서버와 함께 데스크톱 또는 헤드리스 스마트 스피커에서 SUSI.AI를 실행하는 구성 요소가 포함되어 있습니다. 여기에 구현된 기능에는 마이크를 사용하여 음성 명령 수집, Deep Speech, Flite, Pocket Sphinx, IBM Watson 등과 같은 구성 요소를 사용하여 음성을 텍스트(STT)로 변환, 음성 명령으로 볼륨 제어 및 간단한 GTK 인터페이스 제공이 포함됩니다. SUSI.AI 서버(Java로 작성)의 JSON 출력을 사용하기 위해 SUSI.AI API Python Wrapper를 사용합니다. 프로젝트의 궁극적인 목표는 사용자가 IoT 기기, 자동차 시스템, 세탁기 등의 데스크탑과 스마트 스피커를 제외하고 어디에나 SUSI.AI를 설치할 수 있도록 하는 것입니다.
프로젝트의 기능은 다음과 같이 제공됩니다.
SUSI.AI 생태계는 다음과 같은 부분으로 구성됩니다.
* Web Client and Content Management System for the SUSI.AI Skills - Home of the SUSI.AI community
|_ susi.ai (React Application, User Account Management for the CMS, a client for the susi_server at https://api.susi.ai the content management system for susi skills)
* server back-end
|_ susi_server (the brain of the infrastructure, a server which computes answers from queries)
|_ susi_skill_data (the knowledge of the brain, a large collection of skills provided by the SUSI.AI community)
* android front-end
|_ susi_android (Android application which is a client for the susi_server at https://api.susi.ai)
* iOS front-end
|_ susi_iOS (iOS application which is a client for the susi_server at https://api.susi.ai)
* Smart Speaker - Software to turn a Raspberry Pi into a Personal Assistant
| Several sub-projects come together in this device
|_ susi_installer (Framework which can install all parts on a RPi and Desktops, and also is able to create SUSIbian disk images)
|_ susi_python (Python API for the susi_server at https://api.susi.ai or local instance)
|_ susi_server (The same server as on api.susi.ai, hosted locally for maximum privacy. No cloud needed)
|_ susi_skill_data (The skills as provided by susi_server on api.susi.ai; pulled from the git repository automatically)
|_ susi_linux (a state machine in python which uses susi_python, Speech-to-text and Text-to-speech functions)
|_ susi.ai (React Application, the local web front-end with User Account Management, a client for the local deployment of the susi_server, the content management system for susi skills)
susi_linux
는 일반적으로 SUSI 설치 프로그램을 통해 설치됩니다. 이 경우 구성 및 시작을 위한 바이너리와 $HOME/SUSI.AI/bin
(기본 설치 설정 아래)에서 사용할 수 있는 다른 바이너리가 있습니다.
수동 설치의 경우 wrapper
디렉터리의 래퍼는 해당 설치 디렉터리와 config.json
파일의 위치를 가리키도록 구성해야 합니다.
구성은 일반적으로 $HOME/.config/SUSI.AI/config.json
에 있는 config.json 파일을 통해 수행됩니다.
$HOME/SUSI.AI/bin/susi-config
스크립트는 susi_linux
구성을 쿼리, 설정 및 변경하는 데 가장 적합합니다. $HOME/SUSI.AI/bin/susi-linux-configure
구성에 대한 GUI 인터페이스도 있습니다.
가능한 키와 값은 $HOME/SUSI.AI/bin/susi-config keys
실행하여 제공됩니다.
몇 가지 중요한 키와 가능한 값:
- `stt` is the speech to text service, one of the following choices:
- `google` - use Google STT service
- `watson` - IBM/Watson STT
- `bing` - MS Bing STT
- `pocketsphinx` - PocketSphinx STT system, working offline
- `deepspeech-local` - DeepSpeech STT system, offline, WORK IN PROGRESS
- `tts` is the text to speech service, one of the following choices:
- `google` - use Google TTS
- `watson` - IBM/Watson TTS (login credential necessary)
- `flite` - flite TTS service working offline
- `hotword.engine` is the choice if you want to use snowboy detector as the hotword detection or not
- `Snowboy` to use snowboy
- `PocketSphinx` to use Pocket Sphinx
- `wakebutton` is the choice if you want to use an external wake button or not
- `enabled` to use an external wake button
- `disabled` to disable the external wake button
- `not available` for systems without dedicated wake button
Other interfaces for configuration are available for Android and iOS.
Manual configuration is possible, the allowed keys in [`config.json`](config.json) are currently
- `device`: the name of the current device
- `wakebutton`: whether a wake button is available or not
- `stt`: see above for possible settings
- `tts`: see above for possible settings
- `language': language for STT and TTS processing
- `path.base`: directory where support files are installed
- `path.sound.detection`: sound file that is played when detection starts, relative to `data_base_dir`
- `path.sound.problem`: sound file that is played on general errors, relative to `data_base_dir`
- `path.sound.error.recognition`: sound file that is played on detection errors, relative to `data_base_dir`
- `path.sound.error.timeout`: sound file that is played when timing out waiting for spoken commands
- `path.flite_speech`: flitevox speech file, relative to `data_base_dir`
- `hotword.engine`: see above for possible settings
- `hotword.model`: (if hotword.engine = Snowboy) selects the model file for the hotword
- `susi.mode`: access mode to `accounts.susi.ai`, either `anonymous` or `authenticated`
- `susi.user`: (if susi.mode = authenticated) the user name (email) to be used
- `susi.pass`: (if susi.mode = authenticated) the password to be used
- `roomname`: free form description of the room
- `watson.stt.user`, `watson.stt.pass`, `watson.tts.user`, `watson.tts.pass`: credentials for IBM/Watson server for TTS and STT
- `watson.tts.voice`: voice name selected for IBM/Watson TTS
- `bing.api`: Bing STT API key
For details concerning installation, setup, and operation on RaspberryPi, see
the documentation at [SUSI Installer](https://github.com/fossasia/susi_installer).
## Information for developers
This section is intended for developer.
### **Important:** Tests before making a new release
1. The hotword detection should have a decent accuracy
2. SUSI Linux shouldn't crash when switching from online to offline and vice versa (failing as of now)
3. SUSI Linux should be able to boot offline when no internet connection available (failing as of now)
### Roadmap
- Offline Voice Detection (if possible with satisfactory results)
### General working of SUSI
- SUSI.AI follows a finite state system for the code architecture.
- Google TTS and STT services are used as default services but if the internet fails, a switch to offline services PocketSphinx (STT) and Flite (TTS) is made automatically
### Run SUSI Linux for development purposes
If installed via the SUSI Installer, systemd unit files are installed:
- `ss-susi-linux.service` for the user bus, use as user with `systemctl --user start/enable ss-susi-linux`
- `[email protected]` for the system bus, use as `root` user to start a job for a specific user,
independent from whether the user is logged in or not: `sudo systemctl start/enable ss-susi-linux@USER`
By default, it is ran in _production_ mode, where log messages are limited to _error_ and _warning_ only.
In development, you may want to see more logs, to help debugging. You can switch it to "verbose" mode by 2 ways:
1. Run it manually
- Stop systemd service by `sudo systemctl stop ss-susi-linux`
- Use Terminal, _cd_ to `susi_linux` directory and run
python3 -m susi_linux -v
or repeat `v` to increase verbosity:
python3 -m susi_linux -vv
2. Change command run by `systemd`
- Edit the _/lib/systemd/system/ss-susi-linux.service_ and change the command in `ExecStart` parameter:
```ini
ExecStart=/usr/bin/python3 -m susi_linux -v --short-log
systemd 데몬 다시 로드: sudo systemctl daemon-reload
서비스 다시 시작: sudo systemctl restart ss-susi-linux
이제 journalctl
통해 로그를 읽을 수 있습니다.
journalctl -u ss-susi-linux
journalctl -fu ss-susi-linux
하면 로그가 지속적으로 생성될 때 업데이트됩니다. -v
옵션은 실제로 첫 번째 방법과 동일합니다. --short-log
옵션은 journalctl
에서 이미 제공한 일부 정보를 제외하는 것입니다. logging
기능에 대한 자세한 내용은 이 GitHub 문제를 참조하세요.