This commit is contained in:
maglore9900 2024-08-29 13:31:04 -04:00
parent 8ddc735d3f
commit d8e6ee9fb5
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ graph = agent.Agent()
while True: while True:
text = sp.listen2() text = sp.listen2()
if text and "max" in text.lower() or text and "mac" in text.lower(): if text and "max " in text.lower() or text and "mac " in text.lower():
if "exit" in text.lower(): if "exit" in text.lower():
break break
response = loop.run_until_complete(graph.invoke_agent(text)) response = loop.run_until_complete(graph.invoke_agent(text))

View File

@ -121,7 +121,7 @@ class Speak:
def glitch_stream_output(self, text): def glitch_stream_output(self, text):
def change_pitch(sound, octaves): def change_pitch(sound, octaves):
val = random.randint(0, 7) val = random.randint(0, 10)
if val == 1: if val == 1:
new_sample_rate = int(sound.frame_rate * (2.0 ** octaves)) new_sample_rate = int(sound.frame_rate * (2.0 ** octaves))
return sound._spawn(sound.raw_data, overrides={'frame_rate': new_sample_rate}).set_frame_rate(sound.frame_rate) return sound._spawn(sound.raw_data, overrides={'frame_rate': new_sample_rate}).set_frame_rate(sound.frame_rate)
@ -174,7 +174,7 @@ class Speak:
octaves = random.uniform(-0.5, 1.5) octaves = random.uniform(-0.5, 1.5)
modified_chunk = change_pitch(audio_segment, octaves) modified_chunk = change_pitch(audio_segment, octaves)
if random.random() < 0.01: # 1% chance to trigger stutter if random.random() < 0.001: # 1% chance to trigger stutter
repeat_times = random.randint(2, 5) # Repeat 2 to 5 times repeat_times = random.randint(2, 5) # Repeat 2 to 5 times
for _ in range(repeat_times): for _ in range(repeat_times):
stream.write(modified_chunk.raw_data) stream.write(modified_chunk.raw_data)