Copyright © 2001-2019 MultiMedia Soft

CustomDSP.InternalSetFunction method

Previous pageReturn to chapter overviewNext page

Remarks

 

Sets the the callback function of the internal custom DSP. The callback of an internal custom DSP is nothing more than a simple function that will receive original WAV PCM sound data to be modified on the fly.

 

For further details about methods related to the use of custom DSP effects refer to the CustomDSP COM object.

Further information about the use of Custom DSP effects can be found inside the How to manage custom DSP effects tutorial.

 

 

Syntax

 

[Visual Basic]

control.CustomDSP.InternalSetFunction (

nPlayer as Integer,

nIdDsp as Long,

pCallback as Long

) as enumErrorCodes


 

[C++]

short control.CustomDSP.InternalSetFunction (

short nPlayer,

long nIdDsp,

long pCallback

);


 

 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the involved player

nIdDsp

Unique identifier of the custom DSP

pCallback

Pointer to the callback function containing the code that will effectively modify original WAV PCM data. Remember that callback functions must be as fast as possible in order to avoid slowing down overall performances.

A callback function is defined like this:

 

[Visual Basic ]

 

Public Sub MyCustomCallback(

ByVal bufferSamples As Long,

ByVal bufferSamplesLength As Long,

ByVal nUserData As Long

)

 

[Visual C++]

 

void MyCustomCallback (

void *bufferSamples,

DWORD bufferSamplesLength,

DWORD nUserData

);

 

where

bufferSamples

Pointer to the buffer containing WAV PCM samples to be processed by the DSP in one of the following formats:

8-bit samples are unsigned

16-bit samples are signed

32-bit floating-point samples can range from -1 to +1: note that they are not clipped so they could be outside the mentioned range.

 

You can instruct the DSP using 32-bit floating-point samples only through the CustomDSP.UseFloatSample method.

bufferSamplesLength

The length in bytes of the buffer above

nUserData

User specific data

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.