StormLib API Reference

SFileAddWave

Description

bool WINAPI SFileAddWave(
  HANDLE hMpq,                      // Handle to the MPQ
  const char * szFileName,          // The name of a file to be removed
  const char * szArchivedName,      // The name under which the file will be stored
  DWORD dwFlags,                    // Specifies archive flags for the file
  DWORD dwQuality                   // Specifies the quality of the WAVE in the MPQ
);

This function is now obsolete and should not be used. Use SFileAddFileEx for adding WAVE files to an archive.

Function SFileAddWave adds a WAVE file to the MPQ archive. The MPQ must have been open by SFileOpenArchive or created by SFileCreateArchive. Note that this operation might cause MPQ fragmentation. To reduce size of the MPQ, use SFileCompactArchive.

This function is obsolete. WAVE files should be stored the same way like normal data files.

Parameters

hMpq
[in] Handle to an open MPQ. This handle must have been obtained by calling SFileOpenArchive or SFileCreateArchive.
szFileName
[in] Name of a file to be added to the MPQ.
szArchivedName
[in] A name under which the file will be stored into the MPQ. This does not have to be the same like the original file name.
dwFlags
[in] Specifies additional options about how to add the file to the MPQ. For more information about these flags, see SFileAddFileEx.
dwQuality
[in] Specifies quality of WAVE compression. This parameter is ignored if MPQ_FILE_COMPRESS is not specified in dwFlags. The following table shows the possible values and their meaning:
Value Meaning
MPQ_WAVE_QUALITY_HIGH
(0)
The WAVE file will be stored using IMPLODE compression. This ensures the highest quality of the WAVE file.
MPQ_WAVE_QUALITY_MEDIUM
(1)
The WAVE file will be stored using combination of MPQ_COMPRESSION_WAVE_STEREO and MPQ_COMPRESSION_HUFFMANN compressions.
MPQ_WAVE_QUALITY_LOW
(2)
This parameter is obsolete. The WAVE file will be stored the same way like with MPQ_WAVE_QUALITY_MEDIUM.

Return Value

When the function succeeds, it returns nonzero. On an error, the function returns false and GetLastError gives the error code.

Remarks

Only WAVE files shall ever be stored using this method. Attempt to store a data file using SFileAddWave leads to corruption of the file caused by lossy ADPCM compression.

Availability in Storm.dll

Available in Storm.dll No
Ordinal number in Storm.dll 1.00 N/A
Ordinal number in Storm.dll 1.09 N/A