From c7e632c0cfb2ba0cf384443e39a5fb5a2dbea209 Mon Sep 17 00:00:00 2001 From: maglore9900 Date: Thu, 3 Oct 2024 22:30:31 -0400 Subject: [PATCH] added timer variable in env --- README.md | 8 ++++++-- example_env.txt | 3 ++- main.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 23b4759..3bdfecf 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,12 @@ All of the easy configuration is done in the .env file. This section will explai #LISTEN_MODEL will take whisper or google, whisper is the best option but requires additional setup with Nvidia drivers `LISTEN_MODEL='google'` -#STREAM SPEAK URL is using the default url for Alltalk. If you dont have all talk you can ignore this, if you want to use a different service, simply replace the url -`STREAM_SPEAK_URL = 'http://127.0.0.1:7851/api/tts-generate'` + +#TIME_LISTEN is the interval in seconds that the mic is running before adjusting for noise level. If you are talking and getting cut off by the mic cycling, you will want to make this longer. If you listen to music a lot you will want it around its default value of 10 seconds + +`TIME_LISTEN = '10'` + + #STREAM SPEAK URL is using the default url for Alltalk. If you dont have all talk you can ignore this, if you want to use a different service, simply replace the url `STREAM_SPEAK_URL = 'http://127.0.0.1:7851/api/tts-generate'` #-----Spotify, if you want Max to be able to control spotify this is where you will put your credentials `SPOTIFY_CLIENT_ID = ''` diff --git a/example_env.txt b/example_env.txt index 4d92f55..19b48da 100644 --- a/example_env.txt +++ b/example_env.txt @@ -15,7 +15,8 @@ OLLAMA_URL = 'http://localhost:11434' CHARACTER = 'max' #LISTEN_MODEL will take whisper or google, whisper is the best option but requires additional setup with Nvidia drivers -LISTEN_MODEL='google' +LISTEN_MODEL = 'google' +TIME_LIST = '10' #STREAM SPEAK URL is using the default url for Alltalk. If you dont have all talk you can ignore this, if you want to use a different service, simply replace the url STREAM_SPEAK_URL = 'http://127.0.0.1:7851/api/tts-generate' diff --git a/main.py b/main.py index 38efc3c..7e3f0b3 100644 --- a/main.py +++ b/main.py @@ -27,7 +27,7 @@ else: graph = agent.Agent(env,op) while True: - text = graph.spk.listen() + text = graph.spk.listen(int(env("TIME_LISTEN"))) # if text: # print(f"User: {text}") if text and "hey" in text.lower() and env("CHARACTER").lower() in text.lower():