Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
feat(playsounds): add all playsounds (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattbtw authored Feb 25, 2022
1 parent 19bfb43 commit f86524d
Show file tree
Hide file tree
Showing 170 changed files with 17 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ repos:
exclude: CHANGELOG.md
- id: check-yaml
exclude: CHANGELOG.md
- id: check-added-large-files
exclude: CHANGELOG.md

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
Expand Down
31 changes: 17 additions & 14 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,32 @@ def path_exists(filename):
+ "\nThis is used for the play sound functionality in the bot, things like (1) or (2). Don't remove any files from here as it could cause the functionality to not work, and in turn, the bot to not work."
)

# array of the playsounds.
playsounds = []
for file in os.listdir("playsounds"):
# ensures no non-audio files are included (like the README)
if file.endswith(".wav"):
playsounds.append(file)

with open("config.json", "r") as f:
config = json.load(f)


load_dotenv()
log_level = logging.DEBUG if "dev".lower() in sys.argv else logging.INFO


log = logging.getLogger()


logging.basicConfig(
level=log_level,
format="%(name)s - %(message)s",
datefmt="%X",
handlers=[RichHandler()],
)

# array of the playsounds.
playsounds = []
# sourcery skip: list-comprehension
playsounds.extend(file for file in os.listdir("playsounds") if file.endswith(".wav"))

playsounds.sort(
key=lambda test_string: list(map(int, re.findall(r"\d+", test_string)))[0]
)

log.debug(playsounds)

with open("config.json", "r") as f:
config = json.load(f)
load_dotenv()


def request_tts(message: str, failed: Optional[bool] = False):
# sourcery no-metrics
Expand All @@ -126,12 +127,14 @@ def request_tts(message: str, failed: Optional[bool] = False):

if playsound:
i = int(playsound.group()[1:-1]) - 1 # sound 1 = index 0
log.debug(i)

if i < 0 or i > (len(playsounds) - 1):
log.info(f"sound {i} does not exist. it will not be played.")
continue
else:
voice_files.append(f"./playsounds/{playsounds[i]}")
log.debug(playsounds[i])
continue

if message == ",":
Expand Down
Binary file added playsounds/100-splash2.mp3
Binary file not shown.
Binary file added playsounds/100-splash2.wav
Binary file not shown.
Binary file added playsounds/101-spray1.wav
Binary file not shown.
Binary file added playsounds/102-spray2.wav
Binary file not shown.
Binary file added playsounds/103-spring1.wav
Binary file not shown.
Binary file added playsounds/104-spring2.wav
Binary file not shown.
Binary file added playsounds/105-steps-down.wav
Binary file not shown.
Binary file added playsounds/106-suck.wav
Binary file not shown.
Binary file added playsounds/107-swing1.wav
Binary file not shown.
Binary file added playsounds/108-swing2.wav
Binary file not shown.
Binary file added playsounds/109-swing3.wav
Binary file not shown.
Binary file added playsounds/110-switch1.wav
Binary file not shown.
Binary file added playsounds/111-switch2.wav
Binary file not shown.
Binary file added playsounds/112-tape.wav
Binary file not shown.
Binary file added playsounds/113-thump.wav
Binary file not shown.
Binary file added playsounds/114-thunder.wav
Binary file not shown.
Binary file added playsounds/115-toilet-flush.wav
Binary file not shown.
Binary file added playsounds/116-velcro.wav
Binary file not shown.
Binary file added playsounds/117-water-pour.wav
Binary file not shown.
Binary file added playsounds/118-whistle.wav
Binary file not shown.
Binary file added playsounds/119-wood-hammer.wav
Binary file not shown.
Binary file added playsounds/120-writing.wav
Binary file not shown.
Binary file added playsounds/121-zipper1.wav
Binary file not shown.
Binary file added playsounds/122-zipper2.wav
Binary file not shown.
Binary file added playsounds/123-aahhh.wav
Binary file not shown.
Binary file added playsounds/124-argh.wav
Binary file not shown.
Binary file added playsounds/125-bad-dum-tish.wav
Binary file not shown.
Binary file added playsounds/126-burp.wav
Binary file not shown.
Binary file added playsounds/127-cackle.wav
Binary file not shown.
Binary file added playsounds/128-car-beep-beep.wav
Binary file not shown.
Binary file added playsounds/129-car-honk-honk.wav
Binary file not shown.
Binary file added playsounds/130-car-start.wav
Binary file not shown.
Binary file added playsounds/131-clap.wav
Binary file not shown.
Binary file added playsounds/132-clapping.wav
Binary file not shown.
Binary file added playsounds/133-clown-honk.wav
Binary file not shown.
Binary file added playsounds/134-clown-honk-honk.wav
Binary file not shown.
Binary file added playsounds/135-cough.wav
Binary file not shown.
Binary file added playsounds/136-cough-sneeze.wav
Binary file not shown.
Binary file added playsounds/137-cow-moo.wav
Binary file not shown.
Binary file added playsounds/138-crowd-laugh.wav
Binary file not shown.
Binary file added playsounds/139-crying.wav
Binary file not shown.
Binary file added playsounds/140-desk-slam.wav
Binary file not shown.
Binary file added playsounds/141-dog-skittering.wav
Binary file not shown.
Binary file added playsounds/142-door-scratch.wav
Binary file not shown.
Binary file added playsounds/143-drip.wav
Binary file not shown.
Binary file added playsounds/144-drumroll.wav
Binary file not shown.
Binary file added playsounds/145-duck1.wav
Binary file not shown.
Binary file added playsounds/146-duck2.wav
Binary file not shown.
Binary file added playsounds/147-female-cough.wav
Binary file not shown.
Binary file added playsounds/148-female-sneeze.wav
Binary file not shown.
Binary file added playsounds/149-horse2.wav
Binary file not shown.
Binary file added playsounds/150-kiss.wav
Binary file not shown.
Binary file added playsounds/151-knocks2.wav
Binary file not shown.
Binary file added playsounds/152-laugh.wav
Binary file not shown.
Binary file added playsounds/153-male-scream.wav
Binary file not shown.
Binary file added playsounds/154-meow.wav
Binary file not shown.
Binary file added playsounds/155-mmm.wav
Binary file not shown.
Binary file added playsounds/156-monster.wav
Binary file not shown.
Binary file added playsounds/157-mouseclick1.wav
Binary file not shown.
Binary file added playsounds/158-mouseclick2.wav
Binary file not shown.
Binary file added playsounds/159-ooooh.wav
Binary file not shown.
Binary file added playsounds/160-parp.wav
Binary file not shown.
Binary file added playsounds/161-pig.wav
Binary file not shown.
Binary file added playsounds/162-ricochet1.wav
Binary file not shown.
Binary file added playsounds/163-ricochet2.wav
Binary file not shown.
Binary file added playsounds/164-ricochet3.wav
Binary file not shown.
Binary file added playsounds/165-slap.wav
Binary file not shown.
Binary file added playsounds/166-smash.wav
Binary file not shown.
Binary file added playsounds/167-smooch.wav
Binary file not shown.
Binary file added playsounds/168-squeak.wav
Binary file not shown.
Binary file added playsounds/169-squeaky-toy.wav
Binary file not shown.
Binary file added playsounds/170-swear-beep.wav
Binary file not shown.
Binary file added playsounds/171-trombone1.wav
Binary file not shown.
Binary file added playsounds/172-trombone2.wav
Binary file not shown.
Binary file added playsounds/173-trombone3.wav
Binary file not shown.
Binary file added playsounds/174-trombone4.wav
Binary file not shown.
Binary file added playsounds/175-typing1.wav
Binary file not shown.
Binary file added playsounds/176-typing2.wav
Binary file not shown.
Binary file added playsounds/177-wilhelm.wav
Binary file not shown.
Binary file added playsounds/178-balloon-deflate.wav
Binary file not shown.
Binary file added playsounds/179-balloon-pop.wav
Binary file not shown.
Binary file added playsounds/180-blinds-close.wav
Binary file not shown.
Binary file added playsounds/181-bonk.wav
Binary file not shown.
Binary file added playsounds/182-bottle-cork.wav
Binary file not shown.
Binary file added playsounds/183-bottle-pour.wav
Binary file not shown.
Binary file added playsounds/184-bugle.wav
Binary file not shown.
Binary file added playsounds/185-canary1.wav
Binary file not shown.
Binary file added playsounds/186-canary2.wav
Binary file not shown.
Binary file added playsounds/187-can-open.wav
Binary file not shown.
Binary file added playsounds/188-cash-register.wav
Binary file not shown.
Binary file added playsounds/189-cell-door-close.wav
Binary file not shown.
Binary file added playsounds/190-chalk.wav
Binary file not shown.
Binary file added playsounds/191-chew1.wav
Binary file not shown.
Binary file added playsounds/192-chew2.wav
Binary file not shown.
Binary file added playsounds/193-chew3.wav
Binary file not shown.
Binary file added playsounds/194-chew4.wav
Binary file not shown.
Binary file added playsounds/195-chew5.wav
Binary file not shown.
Binary file added playsounds/196-cluck-cluck.wav
Binary file not shown.
Binary file added playsounds/197-coin-collect.wav
Binary file not shown.
Binary file added playsounds/198-creek1.wav
Binary file not shown.
Binary file added playsounds/199-creek2.wav
Binary file not shown.
Binary file added playsounds/200-creek3.wav
Binary file not shown.
Binary file added playsounds/201-creek4.wav
Binary file not shown.
Binary file added playsounds/202-crickets.wav
Binary file not shown.
Binary file added playsounds/203-crow.wav
Binary file not shown.
Binary file added playsounds/204-crunchy-eat.wav
Binary file not shown.
Binary file added playsounds/205-cuckoo.wav
Binary file not shown.
Binary file added playsounds/206-curtain-draw.wav
Binary file not shown.
Binary file added playsounds/207-ding.wav
Binary file not shown.
Binary file added playsounds/208-draw-close.wav
Binary file not shown.
Binary file added playsounds/209-draw-open1.wav
Binary file not shown.
Binary file added playsounds/210-draw-open2.wav
Binary file not shown.
Binary file added playsounds/211-elephant.wav
Binary file not shown.
Binary file added playsounds/212-fanfare.wav
Binary file not shown.
Binary file added playsounds/213-fly.wav
Binary file not shown.
Binary file added playsounds/214-fork-plate1.wav
Binary file not shown.
Binary file added playsounds/215-fork-plate2.wav
Binary file not shown.
Binary file added playsounds/216-frog.wav
Binary file not shown.
Binary file added playsounds/217-goat.wav
Binary file not shown.
Binary file added playsounds/218-gush.wav
Binary file not shown.
Binary file added playsounds/219-hammering.wav
Binary file not shown.
Binary file added playsounds/220-hawk.wav
Binary file not shown.
Binary file added playsounds/221-heart-beat.wav
Binary file not shown.
Binary file added playsounds/222-knife-plate.wav
Binary file not shown.
Binary file added playsounds/223-knife-sharpen.wav
Binary file not shown.
Binary file added playsounds/224-knocks3.wav
Binary file not shown.
Binary file added playsounds/225-microwave-beeps.wav
Binary file not shown.
Binary file added playsounds/226-microwave-end.wav
Binary file not shown.
Binary file added playsounds/227-microwave-run.wav
Binary file not shown.
Binary file added playsounds/228-microwave-start.wav
Binary file not shown.
Binary file added playsounds/229-nibble.wav
Binary file not shown.
Binary file added playsounds/230-open-shower-curtain.wav
Binary file not shown.
Binary file added playsounds/231-owl-hoot.wav
Binary file not shown.
Binary file added playsounds/232-paper-falling.wav
Binary file not shown.
Binary file added playsounds/233-party-horn.wav
Binary file not shown.
Binary file added playsounds/234-phone-click.wav
Binary file not shown.
Binary file added playsounds/235-rattle-door1.wav
Binary file not shown.
Binary file added playsounds/236-rattle-door2.wav
Binary file not shown.
Binary file added playsounds/237-rip1.wav
Binary file not shown.
Binary file added playsounds/238-rip2.wav
Binary file not shown.
Binary file added playsounds/239-rip3.wav
Binary file not shown.
Binary file added playsounds/240-rooster.wav
Binary file not shown.
Binary file added playsounds/241-sawing.wav
Binary file not shown.
Binary file added playsounds/242-snap.wav
Binary file not shown.
Binary file added playsounds/243-splosh.wav
Binary file not shown.
Binary file added playsounds/244-spooky-violin.wav
Binary file not shown.
Binary file added playsounds/245-stone-slide.wav
Binary file not shown.
Binary file added playsounds/246-stretch.wav
Binary file not shown.
Binary file added playsounds/247-sword-fight.wav
Binary file not shown.
Binary file added playsounds/248-tennis1.wav
Binary file not shown.
Binary file added playsounds/249-tennis2.wav
Binary file not shown.
Binary file added playsounds/250-ticking.wav
Binary file not shown.
Binary file added playsounds/251-toaster-pop.wav
Binary file not shown.
Binary file added playsounds/252-toaster-set.wav
Binary file not shown.
Binary file added playsounds/253-twang-woosh.wav
Binary file not shown.
Binary file added playsounds/254-vending-machine.wav
Binary file not shown.
Binary file added playsounds/255-vending-machine-coins.wav
Binary file not shown.
Binary file added playsounds/256-whip-crack.wav
Binary file not shown.
Binary file added playsounds/257-window-knocks1.wav
Binary file not shown.
Binary file added playsounds/258-window-knocks2.wav
Binary file not shown.
Binary file added playsounds/259-window-knocks3.wav
Binary file not shown.
Binary file added playsounds/260-wind-up.wav
Binary file not shown.
Binary file added playsounds/261-witch-laugh.wav
Binary file not shown.
Binary file added playsounds/262-wolf.wav
Binary file not shown.
Binary file added playsounds/263-wood-clatter.wav
Binary file not shown.
Binary file added playsounds/264-zombie1.wav
Binary file not shown.
Binary file added playsounds/265-zombie2.wav
Binary file not shown.
Binary file added playsounds/266-zombie3.wav
Binary file not shown.

0 comments on commit f86524d

Please sign in to comment.