From 358f3ed8c44bbe45d8f4546afeeb0afaae85ea8b Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 30 Aug 2023 17:13:19 -0700 Subject: Continue work on in-game audio, revert steamvr.py We now play arpeggiated *chords* of vowels instead of one, allowing for a denser audio feedback mechanism. --- Scripts/osc_ctrl.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Scripts/osc_ctrl.py') diff --git a/Scripts/osc_ctrl.py b/Scripts/osc_ctrl.py index ad5667f..413e2ae 100644 --- a/Scripts/osc_ctrl.py +++ b/Scripts/osc_ctrl.py @@ -103,18 +103,12 @@ def pageMessage(osc_state: OscState, msg: str, estate: EmotesState) -> bool: sounds_to_make = set() letter_i = 1 for letter in ["a", "e", "i", "o", "u"]: - if letter in msg_slice: + if letter in msg_slice.lower(): sounds_to_make.add(letter_i) letter_i += 1 - if len(sounds_to_make) == 0: + if len(sounds_to_make) > 0: for i in range(5): - playAudio(osc_state, i+1, False) - else: - sound_to_make = random.sample(sounds_to_make, 1)[0] - for i in range(5): - if i+1 == sound_to_make: - # TODO(yum) think about making this probabilistic - print(f"Playing sound {i+1}") + if i+1 in sounds_to_make: playAudio(osc_state, i+1, True) else: playAudio(osc_state, i+1, False) -- cgit v1.2.3