Einzelnen Beitrag anzeigen

greenmile

Registriert seit: 17. Apr 2003
1.107 Beiträge
 
Delphi 10.3 Rio
 
#8

AW: Wasapi Loopback Audio Capturing

  Alt 8. Dez 2016, 16:41
Für alle, die suchen. So Funktioniert es mit der BASS.DLL. Also das Aufzeichnen, obwohl Stereo Mix deaktiviert ist.

Code:
  var
    Count, Count2, rDevice, rFreq, rChannels: Integer;
    di, di2: BASS_DEVICEINFO;
    bi: BASS_INFO;

...
      BASS_SetConfig(BASS_CONFIG_REC_LOOPBACK,1);
      Count  := 1;
      rDevice := -1;
      while BASS_GetDeviceInfo(Count, di) do begin
        If (di.flags and BASS_DEVICE_DEFAULT)=BASS_DEVICE_DEFAULT then begin
          BASS_SetConfig(BASS_CONFIG_REC_LOOPBACK,1);
          Count2 := 0;
          while BASS_RecordGetDeviceInfo(Count2, di2) do begin
            If ((di2.flags and BASS_DEVICE_LOOPBACK)=BASS_DEVICE_LOOPBACK) and (di.driver<>di2.driver) then begin
              rDevice := Count2;
              Break;
            End;
            Inc(Count2);
            If rDevice>=0 then Break;
          End;
        End;
        If rDevice>=0 then Break;
        Inc(Count);
      End;

    BASS_SetDevice(rDevice);
    BASS_GetInfo(bi);
    rFreq := bi.freq;
    rChannels := bi.speakers;

    chAudioRecord := BASS_RecordStart(rFreq, rChannels, BASS_RECORD_PAUSE, @RecordingCallback, 0);
  Mit Zitat antworten Zitat