web版本的音视频聊天室开发
BRAC_ActiveCallLog(TRUE);
// 设置SDK核心组件所在目录
CHAR szCoreSDKPath[MAX_PATH] = {0};
GetModuleFileName(NULL,szCoreSDKPath,sizeof(szCoreSDKPath));
(strrchr(szCoreSDKPath,‘\\‘))[1] = 0;
BRAC_SetSDKOption(BRAC_SO_CORESDK_PATH,szCoreSDKPath,strlen(szCoreSDKPath));
// 根据BRAC_InitSDK的第二个参数:dwFuncMode,来告诉SDK该如何处理相关的任务(详情请参考开发文档)
DWORD dwFuncMode = BRAC_FUNC_VIDEO_CBDATA | BRAC_FUNC_AUDIO_AUTOPLAY | BRAC_FUNC_CHKDEPENDMODULE | BRAC_FUNC_AUDIO_VOLUMECALC | BRAC_FUNC_NET_SUPPORTUPNP | BRAC_FUNC_FIREWALL_OPEN |
BRAC_FUNC_AUDIO_AUTOVOLUME | BRAC_FUNC_CONFIG_LOCALINI;
BRAC_InitSDK(this->GetSafeHwnd()/*NULL*/,dwFuncMode);
// 设置录像临时文件保存路径
CHAR szRecordDirectory[MAX_PATH] = {0};
::GetModuleFileName(NULL,szRecordDirectory,MAX_PATH);
(strrchr(szRecordDirectory,‘\\‘))[1] = 0;
strcat(szRecordDirectory,"Record");
BRAC_SetSDKOption(BRAC_SO_RECORD_TMPDIR,szRecordDirectory,strlen(szRecordDirectory));
// 设置录像文件质量参数
DWORD dwVideoBitrate = 200 * 1000; // 200kbps
BRAC_SetSDKOption(BRAC_SO_RECORD_VIDEOBR,(PCHAR)&dwVideoBitrate,sizeof(DWORD));
DWORD dwAudioBitrate = 96 * 1000; // 96kbps
BRAC_SetSDKOption(BRAC_SO_RECORD_AUDIOBR,(PCHAR)&dwAudioBitrate,sizeof(DWORD));
// 设置快照临时文件保存路径
CHAR szSnapShotDirectory[MAX_PATH] = {0};
::GetModuleFileName(NULL,szSnapShotDirectory,MAX_PATH);
(strrchr(szSnapShotDirectory,‘\\‘))[1] = 0;
strcat(szSnapShotDirectory,"SnapShot");
BRAC_SetSDKOption(BRAC_SO_SNAPSHOT_TMPDIR,szSnapShotDirectory,strlen(szSnapShotDirectory));
// 设置SDK临时文件路径
CHAR szTempPath[MAX_PATH] = {0};
::GetModuleFileName(NULL,szTempPath,MAX_PATH);
(strrchr(szTempPath,‘\\‘))[1] = 0;
strcat(szTempPath,"Temp");
BRAC_SetSDKOption(BRAC_SO_CORESDK_TMPDIR,szTempPath,strlen(szTempPath));
// 启用音频自动参数功能(默认关闭)
DWORD bAudioAutoParam = TRUE;
BRAC_SetSDKOption(BRAC_SO_AUDIO_AUTOPARAM,(PCHAR)&bAudioAutoParam,sizeof(DWORD));
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。