Copyright © 2005-2019 MultiMedia Soft

VideoPlayer.AudioRendererModeSet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Sets the rendering mode for the audio stream of the video clip. The current rendering mode can be obtained through the VideoPlayer.AudioRendererModeGet method.

 

For further details about the use of the embedded video player see the VideoPlayer class section.

For details about video clips rendering refer to the How to play video files through DirectShow tutorial.

 

 

Syntax

 

[Visual Basic]

Public Function AudioRendererModeSet (

nPlayerIndex as Int16,

nMode as enumAudioRendererModes

) as enumErrorCodes


 

[C#]

public enumErrorCodes AudioRendererModeSet (

Int16 nPlayerIndex,

enumAudioRendererModes nMode

);


 

[C++]

public: enumErrorCodes AudioRendererModeSet (

Int16 nPlayerIndex,

enumAudioRendererModes nMode

);


 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the player that will use the video player.

nMode

The audio rendering mode.

Supported values are the following:

Mnemonic constant

Value

Meaning

AUDIO_RENDERER_MODE_CUSTOM (default)

0

Custom renderer: in this case the audio stream is managed separately respect to the normal filter graph, allowing to apply most of the special effects, output redirection, speakers management, ASIO drivers support and visual feedbacks as seen for regular sound files.

When using this mode you could experience a small but constant latency between the audio stream that could be in advance respect to the video video stream rendering: the VideoPlayer.AudioRendererDelaySet method can be used to fine-tune or eliminate this latency.

AUDIO_RENDERER_MODE_CUSTOM_RESAMPLE_STEREO

1

Identical to the custom renderer, performs a resampling to stereo of eventual multi-channel audio streams like 5.1; in this case, all left channels will be mixed inside a single left channel and all right channels will be mixed inside a single right channel.

AUDIO_RENDERER_MODE_CUSTOM_NO_SURROUND

2

Identical to custom renderer, if the audio stream is a multi-channel one, for example a 5.1, only the front channels will be rendered, discarding rear and other surround channels.

AUDIO_RENDERER_MODE_DS_STANDARD

3

Audio is rendered through the default DirectSound audio renderer.

When using this mode, you can only apply volume change, balance change and output device redirection (no speakers management, visual feedbacks, special effects,  etc. available).

Available DirectSound output devices registered as DirectShow audio renderers can be enumerated through the VideoPlayer.AudioRendererDsDeviceGetCount and VideoPlayer.AudioRendererDsDeviceGetDesc methods; the current output device can be changed/obtained through the VideoPlayer.AudioRendererDsDeviceSet and VideoPlayer.AudioRendererDsDeviceGet methods.

When this mode is selected, automatic volume sliding set through the StreamVolumeSmoothingSet method is not available.

AUDIO_RENDERER_MODE_NULL

4

Useful when you need to render the video stream only, audio is sent to a NullRenderer filter, meaning that no audio will be reproduced and less CPU will be used.

AUDIO_RENDERER_MODE_CUSTOM_2

5

Audio is rendered through the default DirectSound audio renderer.

When using this mode, you have the same features available through the AUDIO_RENDERER_MODE_CUSTOM mode with the following exceptions:

- doesn't support speakers management

- doesn't support ASIO drivers

- cannot be attached to a custom stream mixer

- cannot redirect the audio flow to output devices through the StreamOutputDeviceSet method. Available DirectSound output devices registered as DirectShow audio renderers can be enumerated through the VideoPlayer.AudioRendererDsDeviceGetCount and VideoPlayer.AudioRendererDsDeviceGetDesc methods; the current output device can be changed/obtained through the VideoPlayer.AudioRendererDsDeviceSet and VideoPlayer.AudioRendererDsDeviceGet methods.

 

 

 

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.