Compression presets allow compression of wave files in XACT wave banks to reduce wave bank size.
When authoring an XACT project, you may choose to apply compression presets to waves in the project's wave banks. Compression reduces the overall file size of the wave bank files when the project is built, but requires more CPU time to decode when the waves are played, and may result in lower quality audio playback.
Currently, one type of compression is available: ADPCM Compression. This compression method requires that waves adhere to certain conditions if they are to be played continuously. For more information, see ADPCM Compression.
To use compression presets in your XACT project, follow these steps:
You may perform additional actions with compression presets:
Compression Presets are a global setting in the project tree. You may create as many presets as you wish.
To create a compression preset
Right-click on the Compression Presets heading of the project tree.
From the drop-down list that appears, select "New Compression Preset".
Figure 1. Creating a New Preset
A created compression preset has properties associated with it that control the compression settings.
To modify compression properties
Left-click on the compression property you wish to modify in the project tree.
The properties pane below the project tree will show the compression properties.
Figure 2. Properties Pane Showing Compression Properties
Note There are two categories of properties, shown in the properties pane as Windows Properties and Xbox 360 Properties. Windows-only developers should set the compression properties in the Xbox 360 Properties section to None.
Once created, a compression preset can be applied to entire wave banks or individual waves.
To apply a compression preset to an entire wave bank
Left-click on the wave bank you wish to apply compression to in the project tree.
The properties pane below the project tree will show the wave bank properties.
In the properties pane, left-click on the compression preset property, and choose the compression preset you want to apply from the drop-down list, or <None> if you wish to remove compression from a wave.
Figure 3. Wave Bank Properties Showing Compression Preset
Note Applying a compression preset to a wave bank may generate one or more errors or warnings if the individual waves do not meet compression requirements. If errors or warnings occur, they will be listed in a dialog box.
To apply a compression preset to an individual wave
Double-click on the wave bank that contains your target wave in the project tree. The wave bank will open.
In the wave bank window, click on the wave you wish to compress.
The properties pane below the project tree will show the wave properties.
In the properties pane, left-click on the compression preset property, and choose the compression preset you want to apply from the drop-down list. In addition to the compression settings, two additional settings are available:
Option | Meaning |
---|---|
<None> | No compression will be used on this wave. |
(Use Wavebank Settings) | This wave will use the compression type that is used by the wave bank that contains it. |
Figure 4. Wave Properties Showing Compression Preset
Note Applying a compression preset may generate a warning or an error if certain compression requirements are not met. If an error or warning occurs, a dialog box will be shown.
When waves in a wave bank are compressed, you can compare the compressed and uncompressed file sizes, as well as the compression ratio to estimate your file size savings. The wave bank window has two columns that contain this data:
Column Name | Meaning |
---|---|
Size | The size of the uncompressed wave file, in bytes. |
PC Compressed | The size of the compressed wave file, in bytes. |
PC Ratio | A percentage number from 0-100% expressing the ratio of the compressed file size to the uncompressed file size; a value of 25% would indicate a compression rate of 4:1. |
Figure 5. Wave Bank Showing Compressed File Ratios
If a compression preset is no longer needed, you may delete it.
To delete a compression preset
Right-click the compression preset in the project tree, and then select Delete.
Note You can also select the compression preset and then press the DELETE key.