Results 1 to 2 of 2

Thread: DirectPlayVoice

  1. #1
    Ilich
    Guest

    DirectPlayVoice

    Hi! I have some problem with DirectPlayVoice.
    Code:
    FillChar(dvDeviceConfig, sizeof(dvSoundDeviceConfig), 0);
      dvDeviceConfig.dwSize := sizeof(DVSOUNDDEVICECONFIG);
        dvDeviceConfig.dwFlags := DVSOUNDCONFIG_AUTOSELECT;
        dvDeviceConfig.guidPlaybackDevice := DSDEVID_DefaultVoicePlayback;
    
        //dvDeviceConfig.lpdsPlaybackDevice := id ;
    
        dvDeviceConfig.guidCaptureDevice := DSDEVID_DefaultVoiceCapture;
        //dvDeviceConfig.lpdsCaptureDevice := idc;
        dvDeviceConfig.hwndAppWindow := MainForm.Handle;
        //dvDeviceConfig.lpdsMainBuffer := buf;
        dvDeviceConfig.dwMainBufferFlags := 0;
        dvDeviceConfig.dwMainBufferPriority := 0;
    
    
        Fillchar(ClientConfig, sizeof(DVClientConfig), 0);
        ClientConfig.dwFlags := DVCLIENTCONFIG_AUTOVOICEACTIVATED or DVCLIENTCONFIG_AUTORECORDVOLUME;
        ClientConfig.lRecordVolume := DVRECORDVOLUME_LAST;
        ClientConfig.lPlaybackVolume := DVPLAYBACKVOLUME_DEFAULT;
        ClientConfig.dwThreshold := DVTHRESHOLD_UNUSED;
        ClientConfig.dwBufferQuality := DVBUFFERQUALITY_DEFAULT;
        ClientConfig.dwBufferAggressiveness := DVBUFFERAGGRESSIVENESS_DEFAULT;
        ClientConfig.dwNotifyPeriod := 0;
    
    
        hr := g_pVoiceClient.Connect(dvDeviceConfig, ClientConfig, DVFLAGS_SYNC );
        if failed(hr) then
        Begin
          showerror(hr, 'clientvoice');
          result := e_fail;
          Exit;
        End;
    On g_pVoiceClient.Connect error: one or more of the parametrs passed to the mehtod are invalid. Why? May be problem in commented strings (sorry for my english). At the ms directplay help (for c++) told that it is optional parametrs. I have always created idirectsound and idirectsoundcapture objects and passed it to the mehod but not successfull. I cant find solution of this problem. Please help!

  2. #2

    DirectPlayVoice

    If you have the DirectX SDK installed, open the DirectX control panel applet and turn on the debug version. Run the application again in the Delphi debugger and open the event log (View/Debug Windows/Event Log). It should list in there the exact reason for the command failure.

    By the way, cross-posting is considered rude in many forums.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •