Copyright © 2008-2018 MultiMedia Soft

WASAPI.RenderDeviceStartExclusive method

Previous pageReturn to chapter overviewNext page

Remarks

 

Starts a WASAPI device in exclusive mode. In order to start the device in shared mode you can use the WASAPI.RenderDeviceStartShared method. You can know if a WASAPI device is already started through the WASAPI .RenderDeviceIsStarted method.

 

Loopback devices cannot be started in exclusive mode.

 

This method is only effective if the InitDriversType method has been invoked with the nDriverType parameter set to DRIVER_TYPE_WASAPI and must be always called at a later stage respect to the call to the InitEditor method.

 

This method will affect any other instance of the control inside the application. If the control should be used in conjunction with the Active DJ Studio and/or Active Sound Recorder controls, this one would be affected too.

 

This method is only intended for usage with Windows Vista and later versions.

For further details about the use of WASAPI see the WASAPI object and the How to manage audio playback through WASAPI tutorial.

 

 

Syntax

 

[Visual Basic]

control.WASAPI.RenderDeviceStartExclusive (

nDeviceIndex as Integer,

nSampleRate as Long,

nChannels as Integer,

nBufferLengthMs as Long,

nBufferUpdateTimeMs as Long

) as enumErrorCodes


 

[C++]

short control.WASAPI.RenderDeviceStartExclusive (

short nDeviceIndex,

long nSampleRate,

short nChannels,

long nBufferLengthMs,

long nBufferUpdateTimeMs

);


 

Parameter

Description

 

 

nDeviceIndex

Number representing the zero-based index of the WASAPI device whose friendly name must be retrieved. The total number of available WASAPI devices can be obtained using the WASAPI.RenderDeviceGetCount method.

nSampleRate

Sample rate, for example 44100

nChannels

Number of channels

nBufferLengthMs

Length of the buffer expressed in milliseconds.

This value determines the latency and if it should be too small the sound card driver may eventually adjust it to its minimum supported value. You can know if the given length has been accepted by verifying the value of the nLatencyMs parameter after calling the WASAPI.RenderDeviceLatencyGet method.

nBufferUpdateTimeMs

Update time, expressed in milliseconds, for filling the buffer.

You can set this value to 0 in order to let the sound card driver use its default.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful