mirror of
https://github.com/maglore9900/max_headroom.git
synced 2025-06-06 03:25:34 +00:00
.
This commit is contained in:
parent
8ddc735d3f
commit
d8e6ee9fb5
2
main.py
2
main.py
@ -11,7 +11,7 @@ graph = agent.Agent()
|
||||
|
||||
while True:
|
||||
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():
|
||||
break
|
||||
response = loop.run_until_complete(graph.invoke_agent(text))
|
||||
|
@ -121,7 +121,7 @@ class Speak:
|
||||
|
||||
def glitch_stream_output(self, text):
|
||||
def change_pitch(sound, octaves):
|
||||
val = random.randint(0, 7)
|
||||
val = random.randint(0, 10)
|
||||
if val == 1:
|
||||
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)
|
||||
@ -174,7 +174,7 @@ class Speak:
|
||||
octaves = random.uniform(-0.5, 1.5)
|
||||
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
|
||||
for _ in range(repeat_times):
|
||||
stream.write(modified_chunk.raw_data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user