Copyright © 2005-2019 MultiMedia Soft

LoadSoundSync method

Previous pageReturn to chapter overviewNext page

Remarks

 

Loads a song from the specified file through a secondary thread: as you may know, the only way to know the exact song's duration for MP3 files is scanning the file completely and, for very long files, the use of the LoadSound method could be quite lengthy and could temporarily freeze the user interface of the container application. This method avoids any user interface blocking and, once completed, the CallbackForPlayersEvents delegate is invoked with the nEvent parameter set to EV_SOUND_SYNC_LOADED.

 

Accepted audio formats are the same as seen inside the LoadSound method.

 

 

Syntax

 

[Visual Basic]

Public Function LoadSoundSync (

nPlayer as Int16,

strFileName as String

) as enumErrorCodes


 

[C#]

public enumErrorCodes LoadSoundSync (

Int16 nPlayer,

string strFileName

);


 

[C++]

public: enumErrorCodes LoadSoundSync (

Int16 nPlayer,

string strFileName

);


 

 

 

Parameter

Description

 

 

nPlayer

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

strFilename

String containing the name of the song file to load. It can be a full path name (ex. c:\mysounds\sound.mp3) or a filename (ex: sound.mp3) if the SoundsDirectory property has already been specified.

 

 

Return value

 

Value

Meaning

 

 

enumErrorCodes.NOERROR (0)

The method call was successful.

Negative value

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

 

(*) Requires Microsoft Windows Media Format modules already installed on the target PC: you can verify the presence of these modules through a call to the IsWmaAvailable method.

(**) Performs sound tracks only (no video): requires Microsoft Windows Media Format modules already installed on the target PC

(***) Performs sound tracks only (no video)

The Windows Media Format modules can be installed using the redistribution setup package (wmfdist.exe) provided by Microsoft. Details about the integration of these modules inside your own setup package can be found on the following link of the official Microsoft web site (note that in the future this link could change due to the Microsoft site maintenance).