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. --- Sounds/aiueo/a.wav | Bin 79406 -> 38654 bytes Sounds/aiueo/e.wav | Bin 79406 -> 38654 bytes Sounds/aiueo/i.wav | Bin 79406 -> 38654 bytes Sounds/aiueo/o.wav | Bin 79406 -> 38654 bytes Sounds/aiueo/play.py | 9 ++++++--- Sounds/aiueo/u.wav | Bin 79406 -> 38654 bytes 6 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Sounds') diff --git a/Sounds/aiueo/a.wav b/Sounds/aiueo/a.wav index 97fd2ab..06aabc6 100644 Binary files a/Sounds/aiueo/a.wav and b/Sounds/aiueo/a.wav differ diff --git a/Sounds/aiueo/e.wav b/Sounds/aiueo/e.wav index 50f9acf..5bcebf5 100644 Binary files a/Sounds/aiueo/e.wav and b/Sounds/aiueo/e.wav differ diff --git a/Sounds/aiueo/i.wav b/Sounds/aiueo/i.wav index 2c557cf..f1d86c9 100644 Binary files a/Sounds/aiueo/i.wav and b/Sounds/aiueo/i.wav differ diff --git a/Sounds/aiueo/o.wav b/Sounds/aiueo/o.wav index 0fca069..cbafbdb 100644 Binary files a/Sounds/aiueo/o.wav and b/Sounds/aiueo/o.wav differ diff --git a/Sounds/aiueo/play.py b/Sounds/aiueo/play.py index 5d94031..674cf2e 100644 --- a/Sounds/aiueo/play.py +++ b/Sounds/aiueo/play.py @@ -5,7 +5,8 @@ import time def get_wav_files_in_cwd(): """Returns a list of .wav files in the current working directory.""" - return [f for f in os.listdir() if f.endswith('.wav')] + cwd = os.path.dirname(os.path.abspath(__file__)) + return [os.path.join(cwd, f) for f in os.listdir(cwd) if f.endswith('.wav')] # Pro tip: wrap this in a predicate def play_random_wav(wav_files): @@ -15,11 +16,13 @@ def play_random_wav(wav_files): def probably_play_random_wav(wav_files): """Plays a random .wav file from the list. Probably.""" - if random.randint(1,3) != 1: + if random.randint(1,3) == 1: play_random_wav(wav_files) def main(): wav_files = get_wav_files_in_cwd() + for file in wav_files: + print(f"file get: {file}") if not wav_files: print("No .wav files found in the current directory.") return @@ -27,7 +30,7 @@ def main(): try: while True: probably_play_random_wav(wav_files) - time.sleep(0.2) + time.sleep(0.04) except KeyboardInterrupt: print("Program terminated by user.") winsound.PlaySound(None, winsound.SND_PURGE) # Stop any ongoing asynchronous sounds diff --git a/Sounds/aiueo/u.wav b/Sounds/aiueo/u.wav index afea76e..9bb6dda 100644 Binary files a/Sounds/aiueo/u.wav and b/Sounds/aiueo/u.wav differ -- cgit v1.2.3