Skip to content

Commit

Permalink
Update to use OVOSSttFactory directly
Browse files Browse the repository at this point in the history
Mark neon_speech.stt module as deprecated
Update dependencies to latest stable versions
  • Loading branch information
NeonDaniel committed Sep 19, 2024
1 parent 61e0b30 commit bb18c96
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 1 addition & 3 deletions neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
from ovos_dinkum_listener.service import OVOSDinkumVoiceService
from ovos_dinkum_listener.voice_loop.voice_loop import ListeningMode

from neon_speech.stt import STTFactory

ovos_dinkum_listener.plugins.OVOSSTTFactory = STTFactory
from ovos_plugin_manager.stt import OVOSSTTFactory as STTFactory

_SERVICE_READY = Event()

Expand Down
12 changes: 11 additions & 1 deletion neon_speech/stt.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@
from inspect import signature
from threading import Event

from neon_utils import LOG
from ovos_utils.log import LOG, log_deprecation
from ovos_plugin_manager.stt import OVOSSTTFactory, get_stt_config
from ovos_plugin_manager.templates.stt import StreamingSTT

from ovos_config.config import Configuration

log_deprecation("This module is deprecated. Import from `ovos_plugin_manager`",
"5.0.0")


class WrappedSTT(StreamingSTT, ABC):
def __new__(cls, base_engine, *args, **kwargs):
log_deprecation("This class is deprecated. Use "
"`ovos_plugin_manager.templates.stt.StreamingSTT",
"5.0.0")
results_event = kwargs.get("results_event") or Event()
# build STT
for k in list(kwargs.keys()):
Expand Down Expand Up @@ -66,6 +72,10 @@ def stream_stop(self):


class STTFactory(OVOSSTTFactory):
log_deprecation("This class is deprecated. Use "
"`ovos_plugin_manager.stt.OVOSSTTFactory",
"5.0.0")

@staticmethod
def create(config=None, results_event: Event = None):
get_stt_config(config)
Expand Down
4 changes: 2 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
ovos-dinkum-listener~=0.2
ovos-bus-client~=0.0,>=0.0.3
ovos-utils~=0.0,>=0.0.30
ovos-plugin-manager~=0.0,>=0.0.23
Expand All @@ -9,4 +9,4 @@ ovos-config~=0.0,>=0.0.7

ovos-vad-plugin-webrtcvad~=0.0.1
ovos-ww-plugin-vosk~=0.1
ovos-microphone-plugin-alsa~=0.0.0
ovos-microphone-plugin-alsa~=0.1

0 comments on commit bb18c96

Please sign in to comment.