Spaces:
Runtime error
Runtime error
tweak animation speed
Browse files- charles_animator.py +3 -3
charles_animator.py
CHANGED
|
@@ -107,19 +107,19 @@ class CharlesAnimator:
|
|
| 107 |
# Open the mouth when the character starts talking
|
| 108 |
if start_talking:
|
| 109 |
self.mouth_open = True
|
| 110 |
-
self.next_change_in = current_time + random.uniform(0.
|
| 111 |
return self.mouth_open
|
| 112 |
|
| 113 |
# Initialize the next change time if it's zero.
|
| 114 |
if self.next_change_in == 0:
|
| 115 |
-
self.next_change_in = current_time + random.uniform(0.
|
| 116 |
|
| 117 |
# Update the mouth state only if the character is talking.
|
| 118 |
if is_talking:
|
| 119 |
# Check if it's time to change the mouth state.
|
| 120 |
if current_time >= self.next_change_in:
|
| 121 |
self.mouth_open = not self.mouth_open
|
| 122 |
-
self.next_change_in = current_time + random.uniform(0.
|
| 123 |
else:
|
| 124 |
# Close the mouth if the character is not talking.
|
| 125 |
self.mouth_open = False
|
|
|
|
| 107 |
# Open the mouth when the character starts talking
|
| 108 |
if start_talking:
|
| 109 |
self.mouth_open = True
|
| 110 |
+
self.next_change_in = current_time + random.uniform(0.05, 0.25)
|
| 111 |
return self.mouth_open
|
| 112 |
|
| 113 |
# Initialize the next change time if it's zero.
|
| 114 |
if self.next_change_in == 0:
|
| 115 |
+
self.next_change_in = current_time + random.uniform(0.05, 0.25)
|
| 116 |
|
| 117 |
# Update the mouth state only if the character is talking.
|
| 118 |
if is_talking:
|
| 119 |
# Check if it's time to change the mouth state.
|
| 120 |
if current_time >= self.next_change_in:
|
| 121 |
self.mouth_open = not self.mouth_open
|
| 122 |
+
self.next_change_in = current_time + random.uniform(0.05, 0.25)
|
| 123 |
else:
|
| 124 |
# Close the mouth if the character is not talking.
|
| 125 |
self.mouth_open = False
|