I have encountered many problems when I am studying Android development these two days. Now I will record the mediarecorder () recording for my reference only ~~
Very convenient and simple ~~
Mediarecorder recorder = new mediarecorder (); // audio source mic recorder. setaudiosource (mediarecorder. audiosource. MIC); // content output format recorder. setoutputformat (mediarecorder. outputformat. three_gpp); // audio encoding method recorder. setaudioencoder (mediarecorder. audioencoder. amr_nb); recorder. setaudiosamplingrate (177*144); // set the sampling frequency. Set the audio sampling rate Log Based on the output format. I (TAG, "new sampling rate"); audiofile = new file (getcachedir (), mobilenum + "date" + mytools. dateformat () + ". 3GP "); recorder. setoutputfile (audiofile. getabsolutepath (); recorder. prepare (); // The expected recorder. start (); // start recording