Copyright © 2005-2019 MultiMedia Soft

LoadSoundFromZip method

Previous pageReturn to chapter overviewNext page

Remarks

 

Loads a specific entry (sound file) from the specified ZIP file. The sound file can be a stream or a MOD music file.

 

Accepted stream formats are: MP1, MP2, MP3, MP4 (***), AIFF, AAC, M4A, AC3, FLAC, WavPack, ALAC, WAV, OGG Vorbis, WMA (*),  ASF (**), WMV (**), W64, AU, PAF, SVX, NIST, VOC, IRCAM, PVF, CAF, Speex, Musepack, Monkey's Audio (APE), OPUS.

 

Formats wrapped inside a RIFF container (for example GSM 6.10, ADPCM, CCITT, etc. ) are supported if the specific ACM (Audio Compression Manager) codec is installed inside the system.

 

Multi-channel WAV, AIFF, OGG Vorbis and WMA formats are accepted if the output sound card supports speakers assignment and have WDM drivers installed: it's important to note that multi-channel sound files won't allow changing Tempo, Pitch and Playback rate and won't support DMO or EAX effects.

 

Accepted MOD formats are: MOD, MTM, S3M, XM, IT and MO3

 

RAW formats are not supported directly but could be loaded in two steps by decompressing the entry into a memory buffer first, through the ZIP.EntryExtractToMemory method, and then by loading the memory buffer contents through the LoadSoundFromRawMemory method.

 

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

 

For further details about using ZIP management refer to the How to manage ZIP files tutorial.

 

 

Syntax

 

[Visual Basic]

Public Function LoadSoundFromZip (

nPlayerIndex as Int16,

strZipPathname as String,

strPassword as String,

strEntryName as String,

bFailOnLowMemory as Boolean

) as enumErrorCodes


 

[C#]

public enumErrorCodes LoadSoundFromZip (

Int16 nPlayerIndex,

string strZipPathname,

string strPassword,

string strEntryName,

bool bFailOnLowMemory

);


 

[C++]

public: enumErrorCodes LoadSoundFromZip (

Int16 nPlayerIndex,

string strZipPathname,

string strPassword,

string strEntryName,

bool bFailOnLowMemory

);


 

 

 

Parameter

Description

 

 

nPlayerIndex

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

strZipPathname

String containing the absolute pathname of the ZIP file to load.

strPassword

String containing the optional password for accessing the requested entry; leave it empty if not needed.

strEntryName

String representing the name of the entry to extract and load.

bFailOnLowMemory

Flag that determines if, for security purposes, loading of the given entry should fail in case there should be no enough memory for storing the unzipped entry.

Supported values are the following:

Value

Meaning

false

In case memory shouldn't be enough to contain the unzipped entry, the same would be stored inside a temporary file. The temporary file would be automatically deleted when closing the sound file through the CloseSound method or after loading a new sound file into the given player.

true

In case memory shouldn't be enough to contain the unzipped entry, the method's call would fail.

 

 

Return value

 

Value

Meaning

 

 

enumErrorCodes.NOERROR (0)

The song file has been loaded successfully.

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).