<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?action=history&amp;feed=atom&amp;title=Using_a_microphone_as_a_sensor</id>
	<title>Using a microphone as a sensor - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?action=history&amp;feed=atom&amp;title=Using_a_microphone_as_a_sensor"/>
	<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;action=history"/>
	<updated>2026-08-04T14:55:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=42494&amp;oldid=prev</id>
		<title>Michael Murtaugh at 18:17, 25 February 2013</title>
		<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=42494&amp;oldid=prev"/>
		<updated>2013-02-25T18:17:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:17, 25 February 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Uses [[Python]] and [[Gstreamer]], requires &quot;gstreamer python bindings&quot; (sudo apt-get install python-gst0.10).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reading the mike level ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reading the mike level ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Michael Murtaugh</name></author>
	</entry>
	<entry>
		<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=42493&amp;oldid=prev</id>
		<title>Michael Murtaugh at 18:10, 25 February 2013</title>
		<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=42493&amp;oldid=prev"/>
		<updated>2013-02-25T18:10:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:10, 25 February 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Code attached below.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reading the mike level ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Reading the mike level ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l102&quot;&gt;Line 102:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Cookbook]] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Python]] [[Category:Gstreamer]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Cookbook]]&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Attachments ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Attachments ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[File:UsingAMicrophoneAsASensor_level.zip]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[File:UsingAMicrophoneAsASensor_level.zip]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Michael Murtaugh</name></author>
	</entry>
	<entry>
		<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=42491&amp;oldid=prev</id>
		<title>Michael Murtaugh: Michael Murtaugh moved page UsingAMicrophoneAsASensor to Using a microphone as a sensor: camelcase is soooo 90s</title>
		<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=42491&amp;oldid=prev"/>
		<updated>2013-02-25T18:10:01Z</updated>

		<summary type="html">&lt;p&gt;Michael Murtaugh moved page &lt;a href=&quot;/mediadesign/UsingAMicrophoneAsASensor&quot; class=&quot;mw-redirect&quot; title=&quot;UsingAMicrophoneAsASensor&quot;&gt;UsingAMicrophoneAsASensor&lt;/a&gt; to &lt;a href=&quot;/mediadesign/Using_a_microphone_as_a_sensor&quot; title=&quot;Using a microphone as a sensor&quot;&gt;Using a microphone as a sensor&lt;/a&gt;: camelcase is soooo 90s&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:10, 25 February 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Michael Murtaugh</name></author>
	</entry>
	<entry>
		<id>https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=3732&amp;oldid=prev</id>
		<title>Migratebot: Created page with &quot;  Code attached below.  == Reading the mike level ==  The following program uses GStreamer &amp; Python to read the microphone, and prints out numbers of the current microphone...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pzwiki.wdka.nl/mw-mediadesign/index.php?title=Using_a_microphone_as_a_sensor&amp;diff=3732&amp;oldid=prev"/>
		<updated>2010-09-23T19:29:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;  Code attached below.  == Reading the mike level ==  The following program uses GStreamer &amp;amp; Python to read the microphone, and prints out numbers of the current microphone...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
Code attached below.&lt;br /&gt;
&lt;br /&gt;
== Reading the mike level ==&lt;br /&gt;
&lt;br /&gt;
The following program uses GStreamer &amp;amp; Python to read the microphone, and prints out numbers of the current microphone &amp;quot;level&amp;quot; (the &amp;quot;loudness&amp;quot; / volume). It also maintains the minimum and maximum values. The output is simply lines of data to the screen (stdout); so the next step is to feed these numbers (with a shell pipe) into a PyGame program to visualise it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import gst, pygst, struct&lt;br /&gt;
&lt;br /&gt;
(pmin, pmax) = (None, None)&lt;br /&gt;
&lt;br /&gt;
# gboolean message_handler (GstBus * bus, GstMessage * message, gpointer data)&lt;br /&gt;
def listener_on_message (bus, message, data):&lt;br /&gt;
	global pmin, pmax&lt;br /&gt;
	s = message.structure&lt;br /&gt;
	if s and s.get_name() == &amp;quot;level&amp;quot;:&lt;br /&gt;
		rms = s['rms']&lt;br /&gt;
		# also available, but not used here&lt;br /&gt;
		# peak = s['peak']; decay = s['decay']&lt;br /&gt;
		&lt;br /&gt;
		# numbers are in pairs (left, right) -- we use just the first one (left?)&lt;br /&gt;
		p = rms[0]&lt;br /&gt;
		&lt;br /&gt;
		# check against/update min and max&lt;br /&gt;
		if (pmin==None or p&amp;lt;pmin): pmin = p&lt;br /&gt;
		if (pmax==None or p&amp;gt;pmax): pmax = p&lt;br /&gt;
		print &amp;quot;level&amp;quot;, p, pmin, pmax&lt;br /&gt;
&lt;br /&gt;
	return True&lt;br /&gt;
&lt;br /&gt;
listener_desc = 'alsasrc ! level ! fakesink'&lt;br /&gt;
listener = gst.parse_launch(listener_desc)&lt;br /&gt;
listener.get_bus().add_watch(listener_on_message, None)&lt;br /&gt;
&lt;br /&gt;
import gobject&lt;br /&gt;
mainloop = gobject.MainLoop()&lt;br /&gt;
listener.set_state(gst.STATE_PLAYING)&lt;br /&gt;
&lt;br /&gt;
try:&lt;br /&gt;
	mainloop.run()&lt;br /&gt;
except: # an interruption from Ctrl-C&lt;br /&gt;
	print &amp;quot;stopping&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# cleanup&lt;br /&gt;
listener.set_state(gst.STATE_NULL)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Displaying the data with PyGame ==&lt;br /&gt;
&lt;br /&gt;
A PyGame program that reads numbers from stdin (sent by the level program above), and makes a simple visualisation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import sys, pygame, thread&lt;br /&gt;
&lt;br /&gt;
def reader ():&lt;br /&gt;
    while True:&lt;br /&gt;
        line = sys.stdin.readline()&lt;br /&gt;
        evt = pygame.event.Event(pygame.USEREVENT, {&amp;quot;msg&amp;quot; : line.strip()})&lt;br /&gt;
        pygame.event.post(evt)&lt;br /&gt;
&lt;br /&gt;
pygame.init()&lt;br /&gt;
screen = pygame.display.set_mode((640, 480), 0, 32)&lt;br /&gt;
pygame.display.set_caption(&amp;quot;python&amp;quot;)&lt;br /&gt;
clock = pygame.time.Clock()&lt;br /&gt;
level, lo, hi = (0, 0, 1)    &lt;br /&gt;
thread.start_new_thread(reader, ())&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    for event in pygame.event.get():&lt;br /&gt;
        if event.type==pygame.QUIT or \&lt;br /&gt;
        (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE):&lt;br /&gt;
            sys.exit()&lt;br /&gt;
        elif event.type == pygame.USEREVENT:&lt;br /&gt;
            # print event&lt;br /&gt;
            level = event.msg&lt;br /&gt;
            msg = event.msg.split()&lt;br /&gt;
            cmd = msg[0]&lt;br /&gt;
            level = float(msg[1])&lt;br /&gt;
            lo = float(msg[2])&lt;br /&gt;
            hi = float(msg[3])&lt;br /&gt;
    s = (level - lo) / (hi - lo)&lt;br /&gt;
    pos = int(640 * s)&lt;br /&gt;
    screen.fill((0, 0, 0))&lt;br /&gt;
    pygame.draw.rect(screen, (255, 255, 255), (pos, 0, 10, 480), 0)&lt;br /&gt;
    pygame.display.update()&lt;br /&gt;
    clock.tick(30)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Putting the two together ==&lt;br /&gt;
&lt;br /&gt;
To run this, you pipe the output of the first program into the second. Note that the &amp;quot;-u&amp;quot; option is very important -- it tells Python to not buffer (unbufferd) stdin/out. This is important to do &amp;quot;realtime&amp;quot; processing in this case.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
python -u level.py | python -u level_viz.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Cookbook]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Attachments ==&lt;br /&gt;
&lt;br /&gt;
*[[File:UsingAMicrophoneAsASensor_level.zip]]&lt;/div&gt;</summary>
		<author><name>Migratebot</name></author>
	</entry>
</feed>