Skip to content

Commit

Permalink
Before modifying the reply and reply_error
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Sep 4, 2024
1 parent c24cf79 commit 22ef11b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 4 additions & 0 deletions docs/devel/misc/askai-issues.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Major Issues:

- When is_speak, the click is being spoken
- Multiple Scheduler.every
8 changes: 0 additions & 8 deletions docs/devel/misc/askai-questions.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Questions:

en_US

- Summarize my markdown files at my HomeSetup docs folder.
- What are the current weather conditions in San Francisco, U.S today?
- When is the upcoming Los Angeles Lakers match?
Expand All @@ -19,9 +17,3 @@ en_US
- I have downloaded a QR logo, open it to me.
- Tell me who you see using the webcam. Respond like talking to an audience.
- List my music and let me know if there is any gabiroba song. If so, show me the file name and open it.


Major Issues:

TODO

2 changes: 1 addition & 1 deletion src/demo/components/text_streamer_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
""")
text_small = "This is just a simple test to tell that PI is 3.14159265"
scheduler.start()
streamer.stream_text(text_small)
streamer.stream_text(text_big)
2 changes: 1 addition & 1 deletion src/main/askai/core/askai_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def is_speak(self) -> bool:

@is_speak.setter
def is_speak(self, value: bool) -> None:
settings.put("askai.speak.enabled", which("ffplay") and not self.is_debug and value)
settings.put("askai.speak.enabled", which("ffplay") and value)

@property
def is_debug(self) -> bool:
Expand Down
6 changes: 5 additions & 1 deletion src/main/askai/core/component/audio_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import logging as log
import time

from askai.core.askai_configs import configs


class AudioPlayer(metaclass=Singleton):
"""Provide an interface for playing audio through the default speaker device. This class allows for the playback of
Expand All @@ -45,7 +47,9 @@ def play_audio_file(path_to_audio_file: str | Path, tempo: int = 1) -> bool:
:param tempo: The playback speed (default is 1).
:return: True if the audio file is played successfully, otherwise False.
"""
if file_is_not_empty(str(path_to_audio_file)):
if not configs.is_speak:
return True
elif file_is_not_empty(str(path_to_audio_file)):
try:
out, code = Terminal.shell_exec(
f'ffplay -af "atempo={tempo}" -v 0 -nodisp -autoexit {path_to_audio_file}'
Expand Down

0 comments on commit 22ef11b

Please sign in to comment.