How to find maximums or peaks of sound

Thanks you guys, but there is few other things I don´t understand so: how do I choose this threshold and how do I choose this time during which I will be finding max, min = how do I know where is the beggining of the new ,,period of sound" . Jremington is collecting 250 data points, Wawa 500, how did you decide these values?