just a practise for swift. Origin Objective-c implement
A Siri like wave effect
###usage 1.add Waver.swift to your project
2.use it like this
let waver = Wave(frame: CGRectMake(0, 0, 320, 200))
weak var weakWaver = waver;
waver.setWaverLevelCallback( { () -> () in
self.recorder?.updateMeters()
let normalizedValue = pow (10, self.recorder!.averagePowerForChannel(0) / 40);
weakWaver!.level = CGFloat(normalizedValue)
})