Skip to content

Commit

Permalink
daemon: use buttonPress signal to stop recording
Browse files Browse the repository at this point in the history
  • Loading branch information
knuxify committed Apr 19, 2022
1 parent 16201a9 commit 743a698
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
Contains code for the message bus daemon.
"""
from mycroft.util.signal import create_signal
from mycroft_bus_client import MessageBusClient, Message
from gi.repository import Gio
import threading
Expand Down Expand Up @@ -37,7 +38,7 @@ def start_record(self):
def stop_record(self):
"""Stops recording the current voice recognition message."""
self.client.emit(Message('mycroft.stop'))
self.client.emit(Message('recognizer_loop:record_end'))
create_signal('buttonPress')

def to_message(self, message):
"""
Expand All @@ -49,7 +50,7 @@ def to_message(self, message):

def _send_message(self, message, reply_to=None):
"""Sends a text message to the daemon."""
self.client.emit(Message('recognizer_loop:record_end'))
self.stop_record()
if not reply_to:
self.client.emit(Message('recognizer_loop:utterance',
{"utterances": [message], "lang": 'en-us'})
Expand Down

0 comments on commit 743a698

Please sign in to comment.