Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'received:209.85.223': 0.03; 'python': 0.09; 'subject:skip:a 10': 0.09; 'cc:addr:python-list': 0.10; '24,': 0.16; 'fine).': 0.16; 'oct': 0.16; 'options),': 0.16; 'poll': 0.16; 'subject:variable': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'module': 0.19; 'changes': 0.20; 'all,': 0.21; '3.x': 0.22; 'cc:2**0': 0.23; 'changes,': 0.23; "python's": 0.23; "haven't": 0.23; 'cc:no real name:2**0': 0.24; 'idea': 0.24; 'second': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'extend': 0.26; 'message-id:@mail.gmail.com': 0.27; 'lines': 0.28; 'though.': 0.29; "i'm": 0.29; 'that.': 0.30; 'push': 0.30; 'function': 0.30; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'actions': 0.36; 'level.': 0.36; 'should': 0.36; 'subject: (': 0.36; 'option': 0.37; 'level': 0.37; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'little': 0.39; 'header:Received:5': 0.40; 'close': 0.63; 'sound': 0.65; 'subject:,': 0.81; 'listens': 0.84; 'probably,': 0.84; '(running': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=w1WKob40OuZIAumeTUqtjrIY7HYQ1vFluy0Q5BFwhsM=; b=yjkCMTQtvpCaXe/u3Hpm/0nANj4tAK6D22/QHhLil9UhURHJYtW2ryXjbaXb7pIHzX t4OxtyCjYdqdMNs4wQWz1JtiCl1M8r2i+3IevI4HiEX5ik5q9BP9JV1/Omcrs/AJg8jo Ae7LyZVI0t9QGAmAwsLMeEs2gH9VvRQvCf3eScziFXZgcePh2Aa30PDIGy2GVcLhegkm t596uBKh9e1eWia+QWW1AQRgn0+iTR9CjvQPKti0gUp9V4WCu0PV61bHgtInDK5L9brQ A1T5v6r1HxYcgQI/P5pEveIMRzzT4sdd/rl6qTBrrGnJejC3iLxxjnxIo+/pxbUzeETZ c/Rg== MIME-Version: 1.0 In-Reply-To: <508839a7$0$785$58c7af7e@news.kabelfoon.nl> References: <508839a7$0$785$58c7af7e@news.kabelfoon.nl> Date: Wed, 24 Oct 2012 21:42:54 -0400 Subject: Re: Listen for changes in variable (alsaaudio.Mixer(x, x).getvolume(x) From: David Hutto To: Muffinman Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351129376 news.xs4all.nl 6933 [2001:888:2000:d::a6]:56352 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32085 On Wed, Oct 24, 2012 at 2:55 PM, Muffinman wrote: > Hello all, > > I'm new to Python (running 2.6.6 but if necessary 3.x should also be > fine). I have a little idea I hope to accomplish with Python. I want to > listen for changes in Alsa sound volume level and base some actions on > that. With the few lines below I can check the current volume level. Can > I extend this so that the script listens for changes in the volume level > and I can base some actions on it? As speed is quite important it's not > an option to poll every second or so for changes, it has to be close to > instantaneous. > You might have to go to c++(ctypes function call), like I'm going to have to for a oscilloscope(using arecord probably, or other options), and use in line assembly to push straight from/to the register. I haven't had a good look at python's IO module yet though. Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com