Jarvis
Jarvis copied to clipboard
Sounds output doesn't read from the text, kept repeating "what can I do for you?"
I found that when I run some command, and the response is giving some options like:
Sorry, I could not recognise your command. Did you mean:
* movie cast
* movie countries
* movie director
* movie genres
* movie info
* movie plot
* movie producer
* movie rating
* movie runtime
* movie search
* movie year
Jarvis will just repeating "what can I do for you?" as much as how many lines of options in there.
Its annoying to hear repeated sentence and because of this we couldn't hear and choose the option. Is this just happen on my device? or it is how it works currently?
Hi! And thanks for reporting this bug.
Sound output really needs some work - e.g. modules like wiki still print(...)
directly to CLI (instead calling jarvis.say(...)
) so you won't hear anything.
But this is actually a easy to fix, actually quite embarrassing bug. Just merged small patch - should be fixed now.
I see, it seems this repo is no longer maintained?
thanks for your reply, I saw and tried your solution but it started repeating something different, instead of repeating "what can I do for you?", it repeats "dockerfile license makefile.......bla..bla..bla" when I just typed "check".
it should speak these options: check forecast, check time, check weather. sorry I'm still new to python, hope I can contribute soon in the future.
I see, it seems this repo is no longer maintained?
Actually it is - but lots of stuff is work in progress ;).
it repeats "dockerfile license makefile.......bla..bla..bla" when I just typed "check".
That's strange. Like really, really strange. You mean Jarvis is actually reading what files are in Jarvis home directory? Also can't reproduce. Which os / python version are you using?
sorry I'm still new to python, hope I can contribute soon in the future.
By the way: That's no problem at all - this project is quite good for learning ;).
I see, it seems this repo is no longer maintained?
Actually it is - but lots of stuff is work in progress ;).
it repeats "dockerfile license makefile.......bla..bla..bla" when I just typed "check".
That's strange. Like really, really strange. You mean Jarvis is actually reading what files are in Jarvis home directory? Also can't reproduce. Which os / python version are you using?
I'm using macOS mojave 10.14.5 with python3.. not sure if it is happen because I clone from this repo and just implement your solution or not.
Yesterday evening, I tried to clone your repo and run it, but somehow it gets error I couldn't solve about the dependencies so I use this repo back.. Yeah, will learn more about this project once I have free time.
I tried to record jarvis error but since I couldn't upload .m4a files, I change the extension become .txt. You can download and change the extension back to .m4a to listen about the error.
Somehow, after I installed soundflower to record the audio, the error message change to become "uninstall soundflower.. bla..bla..bla", I was guessing the error in my jarvis is related with some jarvis dependency that causing it to read from the system output error?
Sorry for long delay. Finally know what is causing this issue!!! So, macOS - always bit problem for me because I have no way to test ;). The relevant part of the code:
system('say {}'.format(speech))
system uses bash. bash expands the * in 'say * movie cast' to every file in directory - obviously...
So small fix - replace os.system with subprocess - which does not run in shell:
cat <<EOF | git apply
diff --git a/jarviscli/utilities/voice.py b/jarviscli/utilities/voice.py
index a0dd006..6d21b5b 100644
--- a/jarviscli/utilities/voice.py
+++ b/jarviscli/utilities/voice.py
@@ -2,7 +2,7 @@ from utilities.GeneralUtilities import IS_MACOS
if IS_MACOS:
- from os import system
+ import subprocess
else:
import pyttsx3
@@ -30,7 +30,7 @@ class Voice:
class VoiceMac(Voice):
def text_to_speech(self, speech):
- system('say {}'.format(speech))
+ subprocess.check_output(["say", speech])
class VoiceLinux(Voice):
EOF
(Copy-Paste and run from Jarvis home folder)
Would be really nice if you could test this fix before I push - because especially with python so much unexpected stuff can happen ;).
Hi Can you Please check i added one condition for say "what can i do for you?" https://github.com/pnhofmann/Jarvis/pull/1