微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > mt6735 背景录音,进入录影录像,返回录音机的保存画面,点击播放...

mt6735 背景录音,进入录影录像,返回录音机的保存画面,点击播放...

时间:10-02 整理:3721RD 点击:
[Audio Common] 背景录音,进入录影录像,返回录音机的保存画面,点击播放按钮,提示“录音失败,文件被删除”

[DESCRIPTION]
1. 背景录音,进入录影录像.
2. 返回录音机的保存画面,点击播放按钮,提示“录音失败,文件被删除”。

[SOLUTION]
请将文件SoundRecorderService.Java 中的如下代码标记处的代码做修改并验证。
(marked with /**M: change**/) .

1. private void receiveBroADCast(Context context, Intent intent) {
String action = intent.getAction();
String command = intent.getStringExtra(COMMAND);
LogUtils.i(TAG, "<onReceive> action = " + action);
if (Intent.ACTION_MEDIA_EJECT.equals(action)
|| Intent.ACTION_MEDIA_UNMOUNTED.equals(action)) {
// M: when sd card ejected is the current operation path,
// call onError
if (isCurrentAccessStorage(intent.getData())) {
if ((STATE_RECORDING == mCurrentState) || (STATE_PAUSE_RECORDING ==
mCurrentState)) {
mOnErrorListener.onError(ErrorHandle.ERROR_SD_UNMOUNTED_ON_RECORD);
} else {
mOnErrorListener.onError(ErrorHandle.ERROR_SD_UNMOUNTED_WHEN_IDLE);
}
reset();
}
} else if (Intent.ACTION_MEDIA_MOUNTED.equals(action)) {
// tell activity to remove SD_UNMOUNTED dialog
if (null != mOnEventListener) {
mOnEventListener.onEvent(EVENT_STORAGE_MOUNTED);
}
} else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
if (STATE_IDLE != mCurrentState) {
// when change language, update the language of
// notification
showNotification(getApplicationContext());
return;
}
} else if (SOUND_power_DOWN_MSG.equals(action) &&
CMDPAUSE.equals(command)) {
// M: CAMERA begin to record when soundRecorder is
// background record,
// it will send SOUND_POWER_DOWN_MSG, we receive and stop
// record
// The process is same as audio focus loss
if ((STATE_RECORDING == mCurrentState) || (STATE_PAUSE_RECORDING ==
mCurrentState)) {
/**M: change**/
stopRecord();
//stopRecordingAsync();
/**M: change**/
} else if (STATE_PLAYING == mCurrentState) {
/**M: change**/
stopPlay();
//stopPlaybackAsync();
/**M: change**/
}
if (isCurrentFileWaitToSave()) {
saveRecord();
}
} else if (Intent.ACTION_SHUTDOWN.equals(action) ||
ACTION_SHUTDOWN_IPO.equals(action)) {
// save the recording parameters
storeRecordParamsSettings();
}
}

2. public boolean saveRecord() {
if ((null == mCurrentFilePath) ||
!mCurrentFilePath.endsWith(Recorder.SAMPLE_SUFFIX)) {
LogUtils.i(TAG, "<saveRecord> no file need to be saved");
return false;
}
if (!isStorageMounted()) {
LogUtils.i(TAG, "<saveRecord> no storage mounted");
mOnErrorListener.onError(ErrorHandle.ERROR_NO_SD);
return false;
}
String currentFilePath = deleteRecordingFileTmpSuffix();
if (null != currentFilePath) {
mUri = addToMediaDB(new File(currentFilePath));
mCurrentFileDuration = 0;
setCurrentFilePath(null);
mTotalRecordingDuration = 0;
if (null != mUri) {
if (null != mOnEventListener) {
mOnEventListener.onEvent(EVENT_SAVE_SUCCESS);
} else {
// M: when mOnEventListener == null, we use service to show
// toast
/**M: Change**/
SoundRecorderUtils.getToast(getApplicationContext(),R.string.tell_save_rec
ord_success);
/**M: Change**/
}
return true;
}
}
return false;
}
PS:以上修改在patch:ALPS00999923

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top