|
|
hai 1 ano | |
|---|---|---|
| Screenshot | hai 1 ano | |
| amraudiorecorder | hai 1 ano | |
| app | hai 1 ano | |
| gradle | hai 1 ano | |
| .gitignore | hai 1 ano | |
| LICENSE | hai 1 ano | |
| README.md | hai 1 ano | |
| build.gradle | hai 1 ano | |
| gradle.properties | hai 1 ano | |
| gradlew | hai 1 ano | |
| gradlew.bat | hai 1 ano | |
| settings.gradle | hai 1 ano |
Android does not support pause and resume when recording amr audio, so we should do a little trick to support pause and resume funciton.
In Android Studio, just import module amraudiorecorder. In other IDE, you should copy AMRAudioRecorder.java into your project.
// Note: this is not the audio file name, it's a directory.
// AMRAudioRecorder will store audio files into this directory.
// And this should be exist,
// AMRAudioRecorder will not make dir if the dir does not exist.
String recordingDirectory = "A directory absolute path";
AMRAudioRecorder mRecorder = new AMRAudioRecorder(recordingDirectory);
mRecorder.start();
mRecorder.pause();
mRecorder.resume();
mRecorder.stop();
mRecorder.getAudioFilePath();