使用
1 - 在AndroidManifest.xml 中设置权限 request for them in Android 6.0+
|
<
uses-permission
android:name
=
"android.permission.RECORD_AUDIO"
/>
<
uses-permission
android:name
=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
2 - 打开记录的Activity
String filePath = Environment.getExternalStorageDirectory() +
"/audio.wav"
;
int
color = getResources().getColor(R.color.colorPrimaryDark);
int
requestCode =
0
;
AndroidAudioRecorder.with(
this
)
.setFilePath(filePath)
.setColor(color)
.setRequestCode(requestCode)
.record();
效果图

热门源码