Skip to content

Commit

Permalink
Version 1.1-R2
Browse files Browse the repository at this point in the history
- Fixed a few major bugs:
	- Fixed the "Error" taking over all of the Gradio WebUI
		- Happened due to Gradio & FastAPI dependency conflict (reminder: always vet your stuff~!)
	- Fixed issues with the software failing gently when you have no mic
	- Fixed crashes relating to searching for "Minecraft" logs, it now check to see if the module is enabled first
  • Loading branch information
SugarcaneDefender authored Oct 23, 2024
1 parent ab42f93 commit 4f3100d
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 5 deletions.
10 changes: 10 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ Changelog

---.---.---.---

v1.1-R2

- Fixed a few major bugs:
- Fixed the "Error" taking over all of the Gradio WebUI
- Happened due to Gradio & FastAPI dependency conflict (reminder: always vet your stuff~!)
- Fixed issues with the software failing gently when you have no mic
- Fixed crashes relating to searching for "Minecraft" logs, it now check to see if the module is enabled first

---.---.---.---

v1.1

- Visual System
Expand Down
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
opencv-python
gradio~=4.25.0
gradio==4.36.1
keyboard~=0.13.5
mouse~=0.7.1
PyGetWindow~=0.0.9
PythMC~=1.2.2
sounddevice~=0.4.6
colorama~=0.4.6
colorama
humanize~=4.7.0
emoji~=2.9.0
discord
Expand All @@ -14,4 +14,5 @@ python-dotenv~=1.0.0
PyAudio~=0.2.14
pydub~=0.25.1
pyvts~=0.3.2
numpy~=1.24.4
numpy~=1.24.4
fastapi==0.112.2
5 changes: 4 additions & 1 deletion utils/minecraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import utils.settings
import json

chat = ChatLink() # Initialises an instance of ChatLink, to take control of the Minecraft Chat.
from utils.settings import minecraft_enabled

if minecraft_enabled:
chat = ChatLink() # Initialises an instance of ChatLink, to take control of the Minecraft Chat.

last_chat = "None!"
remembered_messages = ["", "Minecraft Chat Loaded!"]
Expand Down
27 changes: 26 additions & 1 deletion utils/volume_listener.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import numpy as np
import sounddevice as sd
from numba.cuda.libdevice import trunc
from sympy import false

duration = 10 #in seconds

Expand All @@ -11,10 +13,15 @@
SPEAKING_DETECTED = False
SPEAKING_TIMER = 0

no_mic = False


def audio_callback(indata, frames, time, status):
global VOL_LISTENER_LEVEL

if no_mic:
VOL_LISTENER_LEVEL = 0

volume_norm = np.linalg.norm(indata) * 10

# for reference, 0-2 is quiet background, 20 - 30 is non direct talking, 40+ is identified talking
Expand All @@ -33,11 +40,29 @@ def get_vol_level():

def run_volume_listener():

allow_mic = False

sound_query = sd.query_devices()
for devices in sound_query:
if devices['max_input_channels'] != 0:
allow_mic = True

if not allow_mic:
print("No mic detected!")

global no_mic
no_mic = True

global VOL_LISTENER_LEVEL
VOL_LISTENER_LEVEL = 0

return

while True:
# Run Stream
stream = sd.InputStream(callback=audio_callback)


# Wait up!
with stream:
sd.sleep(duration * 1000)
sd.sleep(duration * 1000)

0 comments on commit 4f3100d

Please sign in to comment.