AudioRecorder to show the recording time iOS Swift 3

If you want to show the recording time to textView then follow the below code.That will show the 00:00 formation.

            let min = Int(recorder.currentTime / 60)

            let sec = Int(recorder.currentTime.truncatingRemainder(dividingBy: 60))
            let playinTime = String(format: "%02d:%02d", min, sec)
            audioTimer.textplayinTime

In the above min variable is used for calculating the minutes from the recorder.After that sec is used for get the seconds from the recorder.

There after you can display it in your own formation using string format method.

    Comments

    1. Las vegas recording studios Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!

      ReplyDelete

    Post a Comment

    Popular posts from this blog

    Invalid bundle error while upload the app to the app Store

    Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift