<div>Thanks for the responses guys. To elaborate:</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><span id=""></span>1.) Do you want to draw the sound wave from left to right or do you want to<br>draw on the left while scrolling to the right?</div></blockquote>
<div> </div>
<div>I want the window to be static, no scrolling. At the moment I have it drawing the most recent data on the left and the 10 seconds old data on the rightmost part of the window.</div>
<div> </div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>That means you'll need some sort of peak detection ... otherwise what would<br>you draw?</div></blockquote>
<div> </div>
<div>This is a good point. What I tried already was to go through all 480,000 points and draw the amplitude value on the y axis with the x value being just i/1000 (I might double check this later as it seems like more than I remember, I don't have access to the code right now). This drew a fine picture but used a lot of cpu and usually would only run for a few seconds before it stopped updating.</div>
<div> </div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>You could move the graph along by copying the existing image to a<br>temporary surface, clear the primary surface and draw the old image<br>using cairo_set_source_surface with an x-offset. Then you can draw the<br>new data into the space created. </div>
</blockquote>
<div> </div>
<div>By doing this what happens to the old data, does it get clipped and discarded or would it build up a long invisible tail of data? It sounds like a good solution, though I might try getting the appropriate values per pixel column before I draw, doing it that way would undoubtedly be quicker and may be fast enough to draw a fresh graph each time.</div>
<div> </div>
<div>Joe</div></div></div>