Skip to content

Commit

Permalink
4.2.0 (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel authored Oct 27, 2023
2 parents 82a555c + 3e59dbf commit df95146
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ on:
jobs:
license_tests:
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
with:
packages-exclude: '^(precise-runner|fann2|tqdm|bs4|ovos-phal-plugin|ovos-skill|neon-core|nvidia|neon-phal-plugin|bitstruct|audioread).*'
52 changes: 46 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,60 @@
# Changelog

## [4.0.1a2](https://github.com/NeonGeckoCom/neon_speech/tree/4.0.1a2) (2023-07-18)
## [4.2.0](https://github.com/NeonGeckoCom/neon_speech/tree/4.2.0) (2023-10-27)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.0.1a1...4.0.1a2)
[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.1.1a6...4.2.0)

**Fixed bugs:**

- \[BUG\] Docker `start_listening` resource missing [\#170](https://github.com/NeonGeckoCom/neon_speech/issues/170)

## [4.1.1a6](https://github.com/NeonGeckoCom/neon_speech/tree/4.1.1a6) (2023-10-26)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.1.1a5...4.1.1a6)

**Merged pull requests:**

- OVOS Dinkum Listener Backwards Compat [\#178](https://github.com/NeonGeckoCom/neon_speech/pull/178) ([NeonDaniel](https://github.com/NeonDaniel))

## [4.1.1a5](https://github.com/NeonGeckoCom/neon_speech/tree/4.1.1a5) (2023-10-26)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.1.1a4...4.1.1a5)

**Merged pull requests:**

- Stable dependencies for release [\#177](https://github.com/NeonGeckoCom/neon_speech/pull/177) ([NeonDaniel](https://github.com/NeonDaniel))

## [4.1.1a4](https://github.com/NeonGeckoCom/neon_speech/tree/4.1.1a4) (2023-10-13)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.1.1a3...4.1.1a4)

**Merged pull requests:**

- Update Dinkum Listener dependency [\#176](https://github.com/NeonGeckoCom/neon_speech/pull/176) ([NeonDaniel](https://github.com/NeonDaniel))

## [4.1.1a3](https://github.com/NeonGeckoCom/neon_speech/tree/4.1.1a3) (2023-10-03)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.1.1a2...4.1.1a3)

**Merged pull requests:**

- Add timing metrics for minerva testing [\#175](https://github.com/NeonGeckoCom/neon_speech/pull/175) ([NeonDaniel](https://github.com/NeonDaniel))

## [4.1.1a2](https://github.com/NeonGeckoCom/neon_speech/tree/4.1.1a2) (2023-07-28)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.1.1a1...4.1.1a2)

**Merged pull requests:**

- Update dependencies and mark deprecation [\#171](https://github.com/NeonGeckoCom/neon_speech/pull/171) ([NeonDaniel](https://github.com/NeonDaniel))
- Kubernetes/No-audio server compat. [\#174](https://github.com/NeonGeckoCom/neon_speech/pull/174) ([NeonDaniel](https://github.com/NeonDaniel))

## [4.0.1a1](https://github.com/NeonGeckoCom/neon_speech/tree/4.0.1a1) (2023-06-27)
## [4.1.1a1](https://github.com/NeonGeckoCom/neon_speech/tree/4.1.1a1) (2023-07-27)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.0.0...4.0.1a1)
[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/4.1.0...4.1.1a1)

**Merged pull requests:**

- Update Docker to use OVOS\_CONFIG envvars [\#169](https://github.com/NeonGeckoCom/neon_speech/pull/169) ([NeonDaniel](https://github.com/NeonDaniel))
- Update container config handling and resolve logged warnings [\#173](https://github.com/NeonGeckoCom/neon_speech/pull/173) ([NeonDaniel](https://github.com/NeonDaniel))



Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ LABEL vendor=neon.ai \

ENV OVOS_CONFIG_BASE_FOLDER neon
ENV OVOS_CONFIG_FILENAME neon.yaml
ENV XDG_CONFIG_HOME /config

RUN apt-get update && \
apt-get install -y \
Expand Down
1 change: 1 addition & 0 deletions docker_overlay/etc/neon/neon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ sounds:
start_listening: snd/start_listening.wav
end_listening: snd/end_listening.wav
acknowledge: snd/acknowledge.mp3
error: snd/error.mp3
MQ:
server: mq.2021.us
port: 5672
Expand Down
46 changes: 41 additions & 5 deletions neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
from pydub import AudioSegment
from speech_recognition import AudioData
from neon_utils.file_utils import decode_base64_string_to_file
from ovos_utils.log import LOG
from ovos_utils.log import LOG, log_deprecation
from neon_utils.configuration_utils import get_neon_user_config
from neon_utils.metrics_utils import Stopwatch
from neon_utils.user_utils import apply_local_user_profile_updates
from ovos_bus_client import Message
from ovos_config.config import update_mycroft_config
Expand Down Expand Up @@ -79,6 +80,8 @@ def on_started():


class NeonSpeechClient(OVOSDinkumVoiceService):
_stopwatch = Stopwatch("get_stt")

def __init__(self, ready_hook=on_ready, error_hook=on_error,
stopping_hook=on_stopping, alive_hook=on_alive,
started_hook=on_started, watchdog=lambda: None,
Expand Down Expand Up @@ -113,22 +116,53 @@ def __init__(self, ready_hook=on_ready, error_hook=on_error,
init_signal_bus
init_signal_bus(self.bus)
init_signal_handlers()
try:
self._default_user = get_neon_user_config()
except PermissionError:
LOG.warning("Unable to get writable config path; fallback to /tmp")
self._default_user = get_neon_user_config("/tmp")

self._default_user = get_neon_user_config()
self._default_user['user']['username'] = "local"

self.lock = Lock()

self._stop_service = Event()
if self.config.get('listener', {}).get('enable_stt_api', True):
self.api_stt = STTFactory.create(config=self.config,
results_event=None)
else:
LOG.info("Skipping api_stt init")
self.api_stt = None

def _validate_message_context(self, message: Message, native_sources=None):
if message.context.get('destination') and \
"audio" not in message.context['destination']:
log_deprecation(f"Adding audio to destination context for "
f"{message.msg_type}", "5.0.0")
message.context['destination'].append('audio')
return OVOSDinkumVoiceService._validate_message_context(self, message,
native_sources)

def run(self):
if self.config.get('listener', {}).get('enable_voice_loop', True):
OVOSDinkumVoiceService.run(self)
else:
LOG.info(f"Running without voice_loop")
self.register_event_handlers()
self.status.set_ready()
try:
self._stop_service.wait()
except KeyboardInterrupt:
self.status.set_stopping()
except Exception as e:
LOG.exception("voice_loop failed")
self.status.set_error(str(e))
LOG.info("Service stopped")
self._after_stop()

def shutdown(self):
LOG.info("Shutting Down")
self.stop()
self._stop_service.set()

def register_event_handlers(self):
OVOSDinkumVoiceService.register_event_handlers(self)
Expand Down Expand Up @@ -350,10 +384,12 @@ def build_context(msg: Message):
wav_file_path = message.data.get("audio_file")
lang = message.data.get("lang")
try:
_, parser_data, transcriptions = \
self._get_stt_from_file(wav_file_path, lang)
with self._stopwatch:
_, parser_data, transcriptions = \
self._get_stt_from_file(wav_file_path, lang)
message.context["audio_parser_data"] = parser_data
context = build_context(message)
context['timing']['get_stt'] = self._stopwatch.time
data = {
"utterances": transcriptions,
"lang": message.data.get("lang", "en-us")
Expand Down
2 changes: 2 additions & 0 deletions requirements/docker.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ovos-stt-plugin-vosk~=0.1
neon-stt-plugin-nemo~=0.0.2
onnxruntime!=1.16.0 # TODO: Patching https://github.com/microsoft/onnxruntime/issues/17631

# Load alternative WW plugins so they are available
ovos-ww-plugin-pocketsphinx~=0.1
ovos-ww-plugin-precise-lite~=0.1
Expand Down
5 changes: 3 additions & 2 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ovos-dinkum-listener~=0.0.2
ovos-dinkum-listener==0.0.3a16
ovos-bus-client~=0.0.3
ovos-utils~=0.0.30
ovos-plugin-manager~=0.0.23
Expand All @@ -8,4 +8,5 @@ neon-utils[network,audio]~=1.6
ovos-config~=0.0.7

ovos-vad-plugin-webrtcvad~=0.0.1
ovos-ww-plugin-vosk~=0.1
ovos-ww-plugin-vosk~=0.1
ovos-microphone-plugin-alsa~=0.0.0
3 changes: 2 additions & 1 deletion requirements/test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ ovos-stt-plugin-server~=0.0.3
pytest
mock~=4.0
pydub~=0.23
SpeechRecognition~=3.8
SpeechRecognition~=3.8
onnxruntime!=1.16.0 # TODO: Patching https://github.com/microsoft/onnxruntime/issues/17631
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = "4.1.0"
__version__ = "4.2.0"

0 comments on commit df95146

Please sign in to comment.