Copyright © 2005-2020 MultiMedia Soft

StreamMixerCreate method

Previous pageReturn to chapter overviewNext page



Creates a new custom stream mixer object that will send the mixed stream to a given output device.


Custom stream mixers cannot be created when the InitDriversType method has been called with the nDriverType parameter set to a value different from DRIVER_TYPE_DIRECT_SOUND.


Further information about the use of custom Stream Mixers can be found inside the How to use custom Stream Mixers tutorial.





[Visual Basic]

Public Function StreamMixerCreate (

nOutput as Int16,

nFrequency as Int32,

nChannels as Int16

) as Int32



public Int32 StreamMixerCreate (

Int16 nOutput,

Int32 nFrequency,

Int16 nChannels




public: Int32 StreamMixerCreate (

Int16 nOutput,

Int32 nFrequency,

Int16 nChannels









Number representing the zero-based index of the output device. The number and descriptions of available output devices can be obtained with a prior call to the GetOutputDevicesCount and GetOutputDeviceDesc

In case you should simply need sending the output of the stream mixer to a streaming server, without the need to hear what is being played, and you shouldn't need to record PCM in output from the stream mixer using the Audio Sound Recorder component, the presence of an output device wouldn't be needed so you could set this parameter to -1.

In this specific case the playback stream is not created in "playback mode" but in another mode called "decode mode", in this situation, where the sound card driver is not involved, no synchronization is available between the decoder and what is being passed to the encoder: the encoder always requests to the player to pass as much data as possible so you will certainly observe the stream being "played" (but it would be better to say "consumed") at a higher speed: client PCs connected to the same network stream will obviously play at normal speed.


Sample rate expressed in samples per second


Number of output channels: can be set to 1 (Mono) or 2 (Stereo). In order to create a multi-channel stream mixer, use the StreamMixerCreateWithSurround method.




Return value






> 0

Numeric value representing the unique identifier of the stream mixer: this unique identifier will be used in order to invoke further methods related to the use of the stream mixer itself

Negative value

An error occurred: see the LastError property for further error details or for a list of the possible error values.