File was renamed from app/src/main/java/com/future/driver/utils/AudioRecoderUtils.java |
| | |
| | | |
| | | import cn.sinata.xldutils.utils.TimeUtils; |
| | | |
| | | public class AudioRecoderUtils { |
| | | public class AudioRecordUtils { |
| | | |
| | | //文件路径 |
| | | private String filePath; |
| | |
| | | |
| | | private MediaRecorder mMediaRecorder; |
| | | private final String TAG = "fan"; |
| | | public static final int MAX_LENGTH = 1000 * 60;// 最大录音时长1000*60*10; |
| | | public static final int MAX_LENGTH = 1000 * 600;// 最大录音时长十分钟,实际行程设置为5分钟上传一次 |
| | | |
| | | private OnAudioStatusUpdateListener audioStatusUpdateListener; |
| | | private MediaPlayer mMediaPlayer; |
| | |
| | | /** |
| | | * 文件存储默认sdcard/record |
| | | */ |
| | | public AudioRecoderUtils() { |
| | | public AudioRecordUtils() { |
| | | //默认保存路径为/sdcard/record/下 |
| | | this(Environment.getExternalStorageDirectory() + "/record/"); |
| | | } |
| | | |
| | | public AudioRecoderUtils(String filePath) { |
| | | public AudioRecordUtils(String filePath) { |
| | | |
| | | File path = new File(filePath); |
| | | if (!path.exists()) |
| | |
| | | mMediaRecorder = null; |
| | | |
| | | audioStatusUpdateListener.onStop(filePath); |
| | | filePath = ""; |
| | | // filePath = ""; //这行代码会引起连续录音文件为空的bug |
| | | |
| | | } catch (RuntimeException e) { |
| | | if (mMediaRecorder != null) { |