How to record 5 sec of sound from mic and save it as file. java.Android studio

Xarels :

I am trying to voice record 5 sec after a button is click. Is there a ways to do it ? For example, when user clock on a button it starts recording 5 secs and stops. Whatever gets recorded should be saved in mp3 file. The file name is hard coded.

Thanks

Alex :

Refer to Android Audio Capture documentation for recording audio and playing sound back.

This is possibly a duplicate of How to Record Voice in android?

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=7332&siteId=1