summaryrefslogtreecommitdiffstats
path: root/Sounds
diff options
context:
space:
mode:
Diffstat (limited to 'Sounds')
-rw-r--r--Sounds/aiueo/a.wavbin79406 -> 38654 bytes
-rw-r--r--Sounds/aiueo/e.wavbin79406 -> 38654 bytes
-rw-r--r--Sounds/aiueo/i.wavbin79406 -> 38654 bytes
-rw-r--r--Sounds/aiueo/o.wavbin79406 -> 38654 bytes
-rw-r--r--Sounds/aiueo/play.py9
-rw-r--r--Sounds/aiueo/u.wavbin79406 -> 38654 bytes
6 files changed, 6 insertions, 3 deletions
diff --git a/Sounds/aiueo/a.wav b/Sounds/aiueo/a.wav
index 97fd2ab..06aabc6 100644
--- a/Sounds/aiueo/a.wav
+++ b/Sounds/aiueo/a.wav
Binary files differ
diff --git a/Sounds/aiueo/e.wav b/Sounds/aiueo/e.wav
index 50f9acf..5bcebf5 100644
--- a/Sounds/aiueo/e.wav
+++ b/Sounds/aiueo/e.wav
Binary files differ
diff --git a/Sounds/aiueo/i.wav b/Sounds/aiueo/i.wav
index 2c557cf..f1d86c9 100644
--- a/Sounds/aiueo/i.wav
+++ b/Sounds/aiueo/i.wav
Binary files differ
diff --git a/Sounds/aiueo/o.wav b/Sounds/aiueo/o.wav
index 0fca069..cbafbdb 100644
--- a/Sounds/aiueo/o.wav
+++ b/Sounds/aiueo/o.wav
Binary files 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
--- a/Sounds/aiueo/u.wav
+++ b/Sounds/aiueo/u.wav
Binary files differ