2009 306

From XPUB & Lens-Based wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Arduino Serial Control

A quick solution to play overlapping sound with Python / mplayer:

import os
from glob import glob
import subprocess
from random import choice
from time import sleep

sounds = glob("sounds/*.wav")
print sounds

while True:
	rsound = choice(sounds)
	cmd = """mplayer "%s" -endpos 5 &""" % (rsound)
	# print cmd
	os.system(cmd)
	sleep(4)