Skip to content

Commit

Permalink
3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel authored May 10, 2023
2 parents d6c8a23 + 9ccabbf commit bd73279
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ jobs:
with:
base_tag: base
extra_tag: default_model
runner: diana
1 change: 1 addition & 0 deletions .github/workflows/publish_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ jobs:
with:
base_tag: base
extra_tag: default_model
runner: diana
2 changes: 2 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
python_version: "3.8"
docker_build_tests:
uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master
with:
runner: self-hosted
unit_tests:
timeout-minutes: 15
strategy:
Expand Down
24 changes: 14 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# Changelog

## [3.2.2a5](https://github.com/NeonGeckoCom/neon_speech/tree/3.2.2a5) (2023-04-20)
## [3.3.1a3](https://github.com/NeonGeckoCom/neon_speech/tree/3.3.1a3) (2023-05-04)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/3.2.2a4...3.2.2a5)
[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/3.3.1a2...3.3.1a3)

**Merged pull requests:**

- Update to use GH action to propose release [\#146](https://github.com/NeonGeckoCom/neon_speech/pull/146) ([NeonDaniel](https://github.com/NeonDaniel))
- Specify Docker actions to use `diana` action runners [\#151](https://github.com/NeonGeckoCom/neon_speech/pull/151) ([NeonDaniel](https://github.com/NeonDaniel))

## [3.2.2a4](https://github.com/NeonGeckoCom/neon_speech/tree/3.2.2a4) (2023-04-20)
## [3.3.1a2](https://github.com/NeonGeckoCom/neon_speech/tree/3.3.1a2) (2023-05-04)

[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/3.2.1...3.2.2a4)
[Full Changelog](https://github.com/NeonGeckoCom/neon_speech/compare/3.3.1a1...3.3.1a2)

**Merged pull requests:**

- Fix alpha release automation change [\#145](https://github.com/NeonGeckoCom/neon_speech/pull/145) ([NeonDaniel](https://github.com/NeonDaniel))
- Update automation to prep release [\#144](https://github.com/NeonGeckoCom/neon_speech/pull/144) ([NeonDaniel](https://github.com/NeonDaniel))
- Refactor tests to remove messagebus module dependency [\#143](https://github.com/NeonGeckoCom/neon_speech/pull/143) ([NeonDaniel](https://github.com/NeonDaniel))
- Add check for results\_event before trying to set it [\#142](https://github.com/NeonGeckoCom/neon_speech/pull/142) ([NeonDaniel](https://github.com/NeonDaniel))
- Refactor STT init to reduce memory footprint [\#140](https://github.com/NeonGeckoCom/neon_speech/pull/140) ([NeonDaniel](https://github.com/NeonDaniel))
- Troubleshoot Docker build failures [\#149](https://github.com/NeonGeckoCom/neon_speech/pull/149) ([NeonDaniel](https://github.com/NeonDaniel))

## [3.3.1a1](https://github.com/NeonGeckoCom/neon_speech/tree/3.3.1a1) (2023-05-03)

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

**Merged pull requests:**

- Handle hotword engine exception handling with unit tests [\#148](https://github.com/NeonGeckoCom/neon_speech/pull/148) ([NeonDaniel](https://github.com/NeonDaniel))



Expand Down
17 changes: 13 additions & 4 deletions neon_speech/mic.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from mycroft.audio import is_speaking
from mycroft.client.speech.mic import get_silence, ResponsiveRecognizer
from neon_utils import LOG
from ovos_utils.log import LOG
from speech_recognition import AudioSource, AudioData

from neon_transformers.audio_transformers import AudioTransformersService

from mycroft.client.speech.mic import ResponsiveRecognizer


class NeonResponsiveRecognizer(ResponsiveRecognizer):

Expand Down Expand Up @@ -71,6 +70,16 @@ def _skip_wake_word(self):
return True
return False

def feed_hotwords(self, chunk):
try:
if len(self.loop.hot_words) < 1:
raise RuntimeWarning("No hotword engines configured!")
ResponsiveRecognizer.feed_hotwords(self, chunk)
except Exception as e:
LOG.exception(e)
self.stop()
self.loop.needs_reload = True

def check_for_hotwords(self, audio_data, source):
found = False
for ww in super().check_for_hotwords(audio_data, source):
Expand Down
31 changes: 27 additions & 4 deletions tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@

from os.path import dirname, join
from threading import Thread, Event
from time import sleep

CONFIG_PATH = os.path.join(dirname(__file__), "config")
os.environ["XDG_CONFIG_HOME"] = CONFIG_PATH
from ovos_config.config import update_mycroft_config
from mycroft_bus_client import Message
from ovos_utils.log import LOG
from ovos_utils.messagebus import FakeBus
from speech_recognition import AudioData

CONFIG_PATH = os.path.join(dirname(__file__), "config")
os.environ["XDG_CONFIG_HOME"] = CONFIG_PATH


sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))


Expand Down Expand Up @@ -198,6 +199,7 @@ class ServiceTests(unittest.TestCase):

@classmethod
def setUpClass(cls):
from ovos_config.config import update_mycroft_config
from neon_utils.configuration_utils import init_config_dir
init_config_dir()

Expand Down Expand Up @@ -258,6 +260,8 @@ def test_bus_events(self):
self.assertEqual(len(self.bus.ee.listeners(event)), 1)

def test_get_wake_words(self):
from ovos_config.config import update_mycroft_config

resp = self.bus.wait_for_response(Message("neon.get_wake_words"),
"neon.wake_words")
self.assertIsInstance(resp, Message)
Expand Down Expand Up @@ -295,6 +299,8 @@ def test_get_wake_words(self):
self.assertFalse(resp.data['test_ww']['active'])

def test_disable_wake_word(self):
from ovos_config.config import update_mycroft_config

hotword_config = dict(self.hotwords_config)
hotword_config['hey_mycroft']['active'] = True
# hotword_config['hey_neon']['active'] = None
Expand Down Expand Up @@ -354,6 +360,8 @@ def test_disable_wake_word(self):
self.assertEqual(set(self.service.loop.engines.keys()), {'hey_neon'})

def test_enable_wake_word(self):
from ovos_config.config import update_mycroft_config

hotword_config = dict(self.hotwords_config)
hotword_config['hey_mycroft']['active'] = False
hotword_config['hey_neon']['active'] = True
Expand Down Expand Up @@ -406,6 +414,21 @@ def test_enable_wake_word(self):
{'hey_neon', 'hey_mycroft'},
self.service.config['hotwords'])

def test_reload_hotwords(self):
hotwords = self.service.loop.hot_words
self.assertIsNotNone(hotwords)
for spec in hotwords.keys():
engine = self.service.loop.engines[spec].pop('engine')
self.assertIsNotNone(engine)
self.assertIsNone(self.service.loop.engines[spec].get('engine'))
break
mock_chunk = b'\xff' * 1024
self.service.loop.responsive_recognizer.feed_hotwords(mock_chunk)
while self.service.loop.needs_reload:
sleep(0.5)
for spec in hotwords.keys():
self.assertIsNotNone(self.service.loop.engines[spec].get('engine'))


if __name__ == '__main__':
unittest.main()
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__ = "3.3.0"
__version__ = "3.3.1"

0 comments on commit bd73279

Please sign in to comment.