回调函数如下:
我每次打开预览图像的时候,都不会自动打开声音,都要手动的去把电脑的音量打开才会有声音,而且通过NET_DVR_SaveRealData函数保存在本地的录像,打开只有画面,没有声音,请大神们指点指点,谢谢了
procedure testRealDataCallBack_V30(lRealHandle: Longint; dwDataType: Longword; pBuffer: LPByte; dwBufSize: Longword; pUser:Pointer);stdcall;
begin
if dwDataType=NET_DVR_SYSHEAD then
begin
if (not(PlayM4_GetPort(@g_nPort))) then //获取播放库未使用的通道号
begin
Exit;
end; if dwBufSize > 0 then
begin
if not(PlayM4_SetStreamOpenMode(g_nPort, STREAME_REALTIME)) then //设置实时流播放模式
begin
Exit;
end;
if not(PlayM4_OpenStream(g_nPort, pBuffer, dwBufSize, 1024*1024)) then //打开流接口
begin
Exit;
end; if not(PlayM4_SetVolume(g_nPort,100)) then
begin
showmessage('PlayM4_SetVolume error');
Exit;
end; if not(PlayM4_Play(g_nPort, Form1.Btn_Play_Wnd.Handle)) then
begin
Exit;
end; if not (PlayM4_PlaySound(g_nPort)) then
begin
showmessage('PlayM4_PlaySound error');
Exit;
end;
end;
end;
if dwDataType = NET_DVR_STREAMDATA then
begin
if (dwBufSize > 0) and (g_nPort <> -1) then
begin
if not(PlayM4_InputData(g_nPort, pBuffer, dwBufSize)) then
begin
Exit
end;
end;
end;
end;
我每次打开预览图像的时候,都不会自动打开声音,都要手动的去把电脑的音量打开才会有声音,而且通过NET_DVR_SaveRealData函数保存在本地的录像,打开只有画面,没有声音,请大神们指点指点,谢谢了
procedure testRealDataCallBack_V30(lRealHandle: Longint; dwDataType: Longword; pBuffer: LPByte; dwBufSize: Longword; pUser:Pointer);stdcall;
begin
if dwDataType=NET_DVR_SYSHEAD then
begin
if (not(PlayM4_GetPort(@g_nPort))) then //获取播放库未使用的通道号
begin
Exit;
end; if dwBufSize > 0 then
begin
if not(PlayM4_SetStreamOpenMode(g_nPort, STREAME_REALTIME)) then //设置实时流播放模式
begin
Exit;
end;
if not(PlayM4_OpenStream(g_nPort, pBuffer, dwBufSize, 1024*1024)) then //打开流接口
begin
Exit;
end; if not(PlayM4_SetVolume(g_nPort,100)) then
begin
showmessage('PlayM4_SetVolume error');
Exit;
end; if not(PlayM4_Play(g_nPort, Form1.Btn_Play_Wnd.Handle)) then
begin
Exit;
end; if not (PlayM4_PlaySound(g_nPort)) then
begin
showmessage('PlayM4_PlaySound error');
Exit;
end;
end;
end;
if dwDataType = NET_DVR_STREAMDATA then
begin
if (dwBufSize > 0) and (g_nPort <> -1) then
begin
if not(PlayM4_InputData(g_nPort, pBuffer, dwBufSize)) then
begin
Exit
end;
end;
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货