1. A method for real-time traffic detection, wherein the method comprising: capturing ambient sounds as an audio sample in a user device; segmenting the audio sample into a plurality of audio frames; identifying periodic frames amongst the plurality of audio frames, wherein the identifying comprises separating the plurality of audio frames into the periodic frames, non-periodic frames, and silenced frames based on a short term energy level (En) and a Power Spectral Density (PSD) of the plurality of audio frames; and extracting spectral features of the periodic frames for real-time traffic detection.