Browse Source

Merge pull request #165 from MarcusTomlinson/master

WASAPI : Allow loopback without output parameters
tags/5.1.0
garyscavone GitHub 6 years ago
parent
commit
0757c50e3d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      RtAudio.cpp

+ 13
- 1
RtAudio.cpp View File

@@ -4764,6 +4764,13 @@ bool RtApiWasapi::probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
// if device index falls within render devices and is configured for loopback
if ( device < renderDeviceCount && mode == INPUT )
{
// if renderAudioClient is not initialised, initialise it now
IAudioClient*& renderAudioClient = ( ( WasapiHandle* ) stream_.apiHandle )->renderAudioClient;
if ( !renderAudioClient )
{
probeDeviceOpen( device, OUTPUT, channels, firstChannel, sampleRate, format, bufferSize, options );
}

// retrieve captureAudioClient from devicePtr
IAudioClient*& captureAudioClient = ( ( WasapiHandle* ) stream_.apiHandle )->captureAudioClient;

@@ -4793,8 +4800,13 @@ bool RtApiWasapi::probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
// if device index falls within render devices and is configured for output
if ( device < renderDeviceCount && mode == OUTPUT )
{
// retrieve renderAudioClient from devicePtr
// if renderAudioClient is already initialised, don't initialise it again
IAudioClient*& renderAudioClient = ( ( WasapiHandle* ) stream_.apiHandle )->renderAudioClient;
if ( renderAudioClient )
{
methodResult = SUCCESS;
goto Exit;
}

hr = renderDevices->Item( device, &devicePtr );
if ( FAILED( hr ) ) {


Loading…
Cancel
Save