title: Measure volume on tap of button
body: <p>Hey below is a code that measure volume at runtime. I want a button which when tapped once starts volume as in this code and then when tapped again stops measuring. </p>
  
  <pre><code>local g = display.newGroup()
  
  local function newBar()
  local bar = display.newLine( 0, 0, 1, 0 ) 
  bar:setColor( 0, 55, 100, 20 )
  bar.width = 7
  bar.y=400
  bar.x=20
      return bar
  end
  
  
  local volumeBar = newBar()
  
  volumeBar.y =  309
  volumeBar.x = 320
  
  
  function volumeBar:enterFrame ( event )
  
  local v = 20*math.log(r:getTunerVolume())    
  local MINTHRESH = 20
  local LEFTMARGIN = 20
  local ONE = -1
  local v2 = MINTHRESH + math.max (v, -MINTHRESH)
  v2 = (display.contentWidth - 20 ) * v2 / MINTHRESH
  local neg =  math.max ( 20, v2 )
  volumeBar.xScale =  neg * ONE
  if (v &gt;= -4) then
      volumeBar:setColor( 110,  110, 20, 200 )
  
  elseif (v &lt; -4) then
  
  volumeBar:setColor( 235,  80, 80, 233)
  
  end 
  
  end
  
  Runtime:addEventListener("enterFrame", volumeBar)
  
  g:insert(volumeBar)
  </code></pre>
  
  <p>Help please cause here there are 2 taps that need to be done.</p>