Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: William Ray Wing Newsgroups: comp.lang.python Subject: Re: Detection of a specific sound Date: Tue, 03 Nov 2015 09:45:29 -0500 Lines: 65 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de ir16RmFthv3DkPnkthJ1igpqs5HXoOluY3peJSBhG7Jg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.071 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'i\xe2\x80\x99ve': 0.09; 'threshold': 0.09; 'thread': 0.10; 'python': 0.10; 'output': 0.13; '(second': 0.16; 'adjusted': 0.16; 'alarm': 0.16; 'appreciated!': 0.16; 'chained': 0.16; 'consume': 0.16; 'detector,': 0.16; 'detects': 0.16; 'fire,': 0.16; 'ideally,': 0.16; 'microphone': 0.16; 'out?': 0.16; 'received:10.0.1.5': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sequence,': 0.16; 'wrote:': 0.16; 'basically': 0.18; 'driver': 0.18; 'received:10.0.1': 0.18; 'typical': 0.18; '(in': 0.18; 'library': 0.20; 'cc:addr:python.org': 0.20; 'cc:2**1': 0.22; "user's": 0.22; 'trying': 0.22; 'cc:no real name:2**0': 0.22; 'bit': 0.23; 'sort': 0.25; 'error': 0.27; 'finally,': 0.27; 'received:17': 0.27; 'host': 0.28; 'detector': 0.29; 'quiet': 0.29; 'recorded': 0.29; 'ups': 0.29; "i'm": 0.30; 'url:mailman': 0.30; 'another': 0.32; 'run': 0.33; 'url:python': 0.33; 'third': 0.33; 'environment,': 0.33; 'jump': 0.33; 'stream': 0.33; 'url:listinfo': 0.34; 'received:10.0': 0.34; 'add': 0.34; 'that,': 0.34; 'next': 0.35; 'could': 0.35; 'remote': 0.35; 'sometimes': 0.35; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'really': 0.37; 'two': 0.37; 'expect': 0.37; 'environment.': 0.37; 'doing': 0.38; 'monitor': 0.38; 'several': 0.38; 'does': 0.39; 'resources': 0.39; 'url:mail': 0.40; 'header:MIME-version:1': 0.60; 'your': 0.60; 'real': 0.62; 'here.': 0.62; 'skip:n 10': 0.62; 'service.': 0.63; 'more': 0.63; 'personal': 0.63; 'more.': 0.63; 'monitoring': 0.64; 'backup': 0.66; 'frequency': 0.66; 'decided': 0.66; 'act': 0.67; 'phone': 0.68; 'finally': 0.70; 'sound': 0.72; 'watching': 0.72; 'analysis': 0.72; 'power': 0.72; 'battery': 0.84; 'header:In- reply-to:1': 0.84; 'microphone.': 0.84; 'off,': 0.84; 'order:': 0.84; 'receiver': 0.84; 'sensitivity': 0.84; 'sound.': 0.84; 'wires': 0.84; 'absolutely': 0.88; 'on?': 0.91; 'power,': 0.91; 'smoke': 0.91 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-11-03_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510090000 definitions=main-1511030252 In-reply-to: X-Mailer: Apple Mail (2.3096.5) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:98167 > On Oct 25, 2015, at 8:17 PM, Montana Burr = wrote: >=20 > I'm looking for a library that will allow Python to listen for the = shriek of a smoke alarm. Once it detects this shriek, it is to notify = someone. Ideally, specificity can be adjusted for the user's = environment. For example, I expect to need moderate specificity as I = live in a quiet neighborhood, but an apartment dweller might need more. >=20 > I'm thinking of recording a smoke alarm and having the program try to = find the recorded sound in the stream from the microphone. >=20 I=E2=80=99ve been watching this thread and finally decided to jump in. First off, we REALLY need to know a bit more about what you are trying = to accomplish, in what sort of environment, and under what constraints = (legal and otherwise). That last bit is crucial. Is this simply a = heads up e-mail message to be sent or is it a way of notifying a backup = (second tier) monitoring service. Is it for your personal use, or do = you expect to sell it (again crucial). Does the computer you expect to = run this on have a good UPS system (in a typical fire, AC power = frequently fails early, sometimes it is the *cause* of the fire). How = are you going to get that notification out? Does your network have = battery backup? Are you going to buy a station-service cell phone = transmitter? If you are thinking of sending a cell phone msg, how do you = guarantee the receiver is on? LOTS of issues here. Then, having said = that, and in no particular order: 1) the sounders in most smoke alarms use over-driven pizeo-electric = annunciators, their output has a VERY complex frequency spectrum with = LOTS of harmonics. Spectral analysis (combined with threshold analysis) = MIGHT be a good way to go, but doing so in real time with Python would = consume most, if not all the resources of the host computer; 2) You would (personal opinion), be much better off using hardwired or = semi-hardwired detection. There are several ways to go, including a = detector microphone and transmitter such as is used to run a remote = doorbell system (mount the microphone next to the smoke detector, then = tap into the doorbell receiver box). These have adjustable sensitivity = and would basically be a threshold detector. Alternatively, almost all = smoke detectors these days are designed to be chained to each other via = three-wire (plus ground) AC wiring. Two of the wires carry power, the = third triggers all the detectors in the system to sound when if of them = sound. Don=E2=80=99t try to tap the signal wire (liability issues), but = you could add another detector to the system which would act as your = monitor if you tap *its* driver output. 3) Finally, how do you guarantee the computer on which the program is to = run will be up at all times? Does it auto-restart after a power = failure, does the program auto-reload as part of the boot-up sequence, = and finally, is the program going to have absolutely bullet proof error = recovery? -Bill > Any help is greatly appreciated! > --=20 > https://mail.python.org/mailman/listinfo/python-list