How to make a audio/volume/loudness meter

In my iOS app, I want to use an audio meter and use this data to perform an action when the audio levels surpass the threshold. I have searched all over the web and can't find any useful info regarding this. Can someone kindly post some sample code? Thanks

How to make a audio/volume/loudness meter
 
 
Q