Copyright © 2005-2018 MultiMedia Soft

SetSampleRate method

Previous pageReturn to chapter overviewNext page



Sets the sample rate applied to DirectSound buffer during playback. The use of this method will speed up the sound playback and voices will result altered as if an LP disc was played at wrong RPM rate. The current sample rate can be obtained through the GetSampleRate method.

Although the final result could be similar to the one obtained through the Effects.PlaybackRateSet method, this method is not based upon a DSP but acts directly on the DirectSound buffer by changing its frequency.





[Visual Basic]

Public Function SetSampleRate (

nPlayerIndex as Int16,

nSampleRate as Int32

) as enumErrorCodes



public enumErrorCodes SetSampleRate (

Int16 nPlayerIndex,

Int32 nSampleRate




public: enumErrorCodes SetSampleRate (

Int16 nPlayerIndex,

Int32 nSampleRate









Number representing the zero-based index of the involved player


Sample rate expressed in samples per second



Return value






Negative value

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

enumErrorCodes.NOERROR (0)

The method call was successful.