Copyright © 2005-2020 MultiMedia Soft

PlaySound method

Previous pageReturn to chapter overviewNext page



Plays a sound that has been previously loaded through one of the many methods having the "Load" prefix like LoadSound or LoadSoundFromMemory,


By default playback continues till the end of the sound stream until the final position is not moved through the PlaySoundMoveFinalPos method.

In case the need should be playing a specific range of the loaded sound, the PlaySoundRange method would be the alternative choice.


A successful call to this method invokes the CallbackForPlayersEvents delegate with the nEvent parameter set to EV_SOUND_PLAYING.

Once the sound has been performed completely, the CallbackForPlayersEvents delegate is invoked with the nEvent parameter set to EV_SOUND_DONE.


In case the given player should have been loaded with a video clip, the call to this method would have the same effect of the VideoPlayer.Play method.





[Visual Basic]

Public Function PlaySound (

nPlayerIndex as Int16

) as enumErrorCodes



public enumErrorCodes PlaySound (

Int16 nPlayerIndex




public: enumErrorCodes PlaySound (

Int16 nPlayerIndex










Number representing the zero-based index of the player that will play the sound



Return value






Negative value

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

enumErrorCodes.NOERROR (0)

The method call was successful