回调函数如下:
我每次打开预览图像的时候,都不会自动打开声音,都要手动的去把电脑的音量打开才会有声音,而且通过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;

解决方案 »

  1.   

    海康设备 都有开发SDK 和 Demo 吧我每次打开预览图像的时候,都不会自动打开声音,都要手动的去把电脑的音量打开才会有声音这应该跟系统有关吧 
      

  2.   

    俺就奇怪,为啥不找厂商需求支持,它们会提供sdk及相应文档的啊
      

  3.   

    不要奇怪,厂商SDK文档根本找不到相关说明
      

  4.   

    我也遇到这样奇怪的问题,预览的时候调用SDK播放声音回调成功,但就是没声音,楼主解决了没?