1
0
mirror of https://github.com/rhasspy/rhasspy.git synced 2022-02-12 01:59:45 +03:00

Multiple site ids for some HTTP API calls. Fixes for venv install.

This commit is contained in:
Michael Hansen
2020-05-28 15:51:25 -04:00
parent 16e5c6b588
commit eaea71c1d4
6 changed files with 34 additions and 21 deletions

View File

@@ -137,7 +137,8 @@ install-dependencies: install-opengrm \
install-julius \
install-snowboy \
install-deepspeech \
install-kenlm
install-kenlm \
install-nanotts
install-rhasspy:
"$(INSTALL_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) "$(srcdir)"
@@ -147,9 +148,9 @@ install-rhasspy:
install -D "--target-directory=$(DESTDIR)$(prefix)/share/rhasspy/etc" "${srcdir}/etc/shflags"
install -D "--target-directory=$(DESTDIR)$(prefix)/share/rhasspy/wav" "${srcdir}/etc/wav"/*.wav
install -D "--target-directory=$(DESTDIR)$(prefix)/share/rhasspy" VERSION README.md LICENSE
cp -fR "${srcdir}/rhasspy-server-hermes/web/docs" "$(DESTDIR)$(prefix)/share/rhasspy/"
cp -fR "${srcdir}/rhasspy-server-hermes/web" "$(DESTDIR)$(prefix)/share/rhasspy/"
cp -fR "${srcdir}/rhasspy-server-hermes/templates" "$(DESTDIR)$(prefix)/share/rhasspy/"
cp -fR "${srcdir}/rhasspy-server-hermes/web/docs" "$(DESTDIR)$(prefix)/share/rhasspy/"
# -----------------------------------------------------------------------------
@@ -402,7 +403,7 @@ install-nanotts: $(NANOTTS_PRE_FILE)
ifeq ($(NANOTTS_FROM),prebuilt)
$(NANOTTS_PRE_FILE):
$(DO_DOWNLOAD) "$(NANOTTS_PRE_FILE)" "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/nanotts-20200520_$(DOCKER_ARCH).tar.gz
$(DO_DOWNLOAD) "$(NANOTTS_PRE_FILE)" "https://github.com/synesthesiam/prebuilt-apps/releases/download/v1.0/nanotts-20200520_$(DOCKER_ARCH).tar.gz"
else # NANOTTS_FROM
$(NANOTTS_PRE_FILE): $(NANOTTS_SRC_FILE)
"$(srcdir)/scripts/build/build-nanotts.sh" "$(NANOTTS_SRC_FILE)" "$(BUILD_DIR)" "$(NANOTTS_PRE_FILE)"
@@ -414,7 +415,7 @@ install-nanotts:
endif # ENABLE_NANOTTS
$(NANOTTS_SRC_FILE):
$(DO_DOWNLOAD) "$(NANOTTS_SRC_FILE)" 'https://github.com/synesthesiam/prebuilt-apps/raw/master/download/nanotts-20200520.tar.gz
$(DO_DOWNLOAD) "$(NANOTTS_SRC_FILE)" 'https://github.com/synesthesiam/prebuilt-apps/raw/master/download/nanotts-20200520.tar.gz'
# -----------------------------------------------------------------------------

View File

@@ -459,6 +459,7 @@ Application authors may want to use the [rhasspy-client](https://pypi.org/projec
* <a id="api_listen_for_wake"><tt>/api/listen-for-wake</tt></a>
* POST "on" to have Rhasspy listen for a wake word
* POST "off" to disable wake word
* `?siteId=site1,site2,...` to apply to specific site(s)
* <a id="api_lookup"><tt>/api/lookup</tt></a>
* POST word as plain text to look up or guess pronunciation
* `?n=<number>` - return at most `n` guessed pronunciations
@@ -476,6 +477,7 @@ Application authors may want to use the [rhasspy-client](https://pypi.org/projec
* <a id="api_play_wav"><tt>/api/play-wav</tt></a>
* POST to play WAV data
* Make sure to set `Content-Type` to `audio/wav`
* `?siteId=site1,site2,...` to apply to specific site(s)
* <a id="api_profile"><tt>/api/profile</tt></a>
* GET the JSON for your profile, or POST to overwrite it
* `?layers=profile` to only see settings different from `defaults.json`
@@ -520,6 +522,7 @@ Application authors may want to use the [rhasspy-client](https://pypi.org/projec
* `?voice=<voice>` - override default TTS voice
* `?language=<language>` - override default TTS language or locale
* `?repeat=true` - have Rhasspy repeat the last sentence it spoke
* `?siteId=site1,site2,...` to apply to specific site(s)
* <a id="api_train"><tt>/api/train</tt></a>
* POST to re-train your profile
* <a id="api_tts_voices"><tt>/api/tts-voices</tt></a>

View File

@@ -1,18 +1,27 @@
#!/usr/bin/env bash
prefix="@prefix@"
virtualenv="@VIRTUALENV@"
export RHASSPY_BASE_DIR="${prefix}/share/rhasspy"
export RHASSPY_WEB_DIR="${RHASSPY_BASE_DIR}/web"
in_place="@IN_PLACE@"
if [[ "${virtualenv}" = 'yes' ]]; then
echo "Using virtual environment at ${prefix}"
if [[ "${in_place}" == 'yes' ]]; then
# Run directly from source code
this_dir="$( cd "$( dirname "$0" )" && pwd )"
"${this_dir}/bin/rhasspy-voltron" "$@"
else
# Use virtual environment as a prefix
prefix="@prefix@"
virtualenv="@VIRTUALENV@"
export RHASSPY_BASE_DIR="${prefix}/share/rhasspy"
export RHASSPY_WEB_DIR="${RHASSPY_BASE_DIR}/web"
# Use virtual environment
source "${prefix}/bin/activate"
if [[ "${virtualenv}" = 'yes' ]]; then
echo "Using virtual environment at ${prefix}"
# Use virtual environment
source "${prefix}/bin/activate"
fi
export LD_LIBRARY_PATH="${prefix}/lib:${LD_LIBRARY_PATH}"
export PATH="${prefix}/bin:${PATH}"
export KALDI_DIR="${prefix}/lib/kaldi"
rhasspy-voltron "$@"
fi
export LD_LIBRARY_PATH="${prefix}/lib:${LD_LIBRARY_PATH}"
export PATH="${prefix}/bin:${PATH}"
export KALDI_DIR="${prefix}/lib/kaldi"
rhasspy-voltron "$@"