|
//建立通话后调用 void initRecord(){
// 设置录像格式参数为:int型, 0 MP4[默认], 1 WMV, 2 FLV, 3 MP3
AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_RECORD_FILETYPE, 3);
//< 设置软件音量模式控制(参数为int型,1打开,0关闭[默认]),使用软件音量模式,将不会改变系统的音量设置
AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_AUDIO_SOFTVOLMODE, 1);
//// 设置外部输入音频格式
AnyChatCoreSDK.SetInputAudioFormat(1, 1600, 16, 0);
//录制文件不按日期分目录保存,全部生成在指定文件夹中(参数为:int型, 0禁止[默认] 1 开
anyChatSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_RECORD_DISABLEDATEDIR, 1);
// 设置录像存储路径
anyChatSDK.SetSDKOptionString(AnyChatDefine.BRAC_SO_RECORD_TMPDIR, Environment.getExternalStorageDirectory() + mStrBasePath + "/");
// anyChatSDK.SetSDKOptionString(AnyChatDefine.BRAC_SO_RECORD_TMPDIR, Environment.getExternalStorageDirectory() + mStrBasePath + "/Recording/");
// anyChatSDK.SetSDKOptionString(AnyChatDefine.BRAC_SO_RECORD_TMPDIR, Environment.getExternalStorageDirectory().toString());
//用户音频控制
anyChatSDK.UserSpeakControl(userID, 1);
anyChatSDK.UserSpeakControl(-1, 1);// -1表示对本地音频进行控制,打开本地音频
}
//初始化相关录制配置后
void startRecord() {
anyChatSDK.StreamRecordCtrlEx(-1, 1, mdwFlags, 0, szUserStr);
}
//断开连接调用
void closeRecord() {
handler.removeCallbacks(runnable);
anyChatSDK.UserSpeakControl(userID, 0);
anyChatSDK.UserSpeakControl(-1, 0);
anyChatSDK.mSensorHelper.DestroySensor();
anyChatSDK.StreamRecordCtrlEx(-1, 0, mdwFlags, 0, szUserStr);
}
MP4 WMV FLV可以正常录制 MP3无法录制附Log
|
|