View Single Post
Posts: 1 | Thanked: 38 times | Joined on Jul 2014
#1
Hey all,

I hope this is the right place to post this I've somehow managed to make my N900 detect movements (and their distances) by checking how the echo of a sound is altered with a Python script that's rather dirty than quick. The way It's recording and playing audio is more a hack than a proper solution, but for some reason it's working. It requires python-numpy and alsa-utils to be installed.

EDIT: It seems like Python is not always taking care of the two subprocesses this script is spawning. The right solution might be wrapping the whole thing in a try-catch-block and cleaning up yourself. I prefer the lazy solution: Starting it with "python echo.py; killall arecord; killall aplay;" If the subprocess module doesn't do it's job properly, killall can take care of it

EDIT2: As Vento suggested, I've added "Script" to the title.

Please tell me if there's a way to embed the video that I've missed. Just in case

Demo Video
The script on pastebin

Last edited by Encypruon; 2014-07-12 at 11:00.
 

The Following 38 Users Say Thank You to Encypruon For This Useful Post: