What is the best way to simulate a VU meter [1] with gstreamer? ( Preferably, I would get value readings as a percent... unless I make it go to 11 :-) )<div><br></div><div>I am currently grabbing buffers on their way to a fake sink, and then using numpy in python extracting an average value out of the buffer:</div>
<div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>temp_ay = np.asarray( <meta http-equiv="content-type" content="text/html; charset=utf-8">fromstring( buffer, 'int16' ) )</div>
</div><div><div><div>v = 0</div></div></div><div><div><div>for b in temp_ay:</div></div></div><div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>v = v + abs(b)</div></div></div><div><div><div>avg = v / len(<meta http-equiv="content-type" content="text/html; charset=utf-8">temp_ay)</div>
</div></div></blockquote><div><div><br></div><div><br></div><div>Using this approach, I don't know what the upper bound is... I just get some value which appears to go up and down as I make noise. </div><div><br></div>
<div>This works, but surely there is: (1) a better way; (2) some way to know what the upper bound is so a percentage can be calculated?</div><div><br></div><div>Thanks!</div><div><br></div><div>[1] <a href="http://en.wikipedia.org/wiki/VU_meter">http://en.wikipedia.org/wiki/VU_meter</a></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"></div>