Generic RWAC Wave Content: Difference between revisions
(Created page.) |
m (Fix infobox) |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ParadiseResourceTypeInfobox |
|||
⚫ | |||
| name = GenericRwacWaveContent |
|||
| othernames = Generic Wave Content |
|||
| id = 0xA020 |
|||
| category = Sound |
|||
| memdist = SNR in Main Memory<br />Audio data in [[Bundle 2/Burnout Paradise#Memory types|secondary]] |
|||
| editor = Yes*<br /><sup><small>*EALayer3 codecs only</small></sup><br />Use [[Modding/Burnout Paradise|EALayer3]] |
|||
}} |
|||
⚫ | |||
For reference, RWAC ('''R'''ender'''W'''are '''A'''udio '''C'''ore) is the audio library used by Burnout Paradise and other EA games. |
|||
= Generating assets = |
= Generating assets = |
||
Line 5: | Line 16: | ||
=== Codec === |
=== Codec === |
||
As noted in the [[#EA::Audio::Core::SndPlayerCodec |
As noted in the [[#EA::Audio::Core::SndPlayerCodec|enumeration]], there are several codecs to choose from when encoding. ''Burnout'' primarily uses EALayer3, a proprietary offshoot of MPEG Layer 3, or its Spike variant. It also uses XAS certain engine sounds, namely ignition, for reasons unknown. The Xbox 360 version uses EA-XMA for all audio except acceleration/deceleration, which is done with [[Ginsu Wave Content|Ginsu]] resources. |
||
=== Play location === |
=== Play location === |
||
Three play locations are supported: RAM, stream, and gigasample. RAM-targeted assets are self-contained and generally found in engines, [[Splicer |
Three play locations are supported: RAM, stream, and gigasample. RAM-targeted assets are self-contained and generally found in engines, [[Splicer|splicers]], and [[AEMS Bank|AEMS banks]], while streams have data separate from the header and stored in persistent memory instead of RAM. Gigasamples are like streams, but with a portion in RAM so slow access times on the stream portion do not slow initial playback of the asset. |
||
=== Loops === |
=== Loops === |
||
Line 14: | Line 25: | ||
=== Data === |
=== Data === |
||
In these assets, sound data is stored in [[#Chunk |
In these assets, sound data is stored in [[#Chunk|chunks]] to be loaded, played, and unloaded in sequence. This is done to minimize RAM usage and increase streaming efficiency. All other data is that of the sound itself. |
||
= |
= Structures = |
||
'''Note: Waves begin with a [[Binary File]] resource |
'''Note: Waves begin with a [[Binary File]] resource''' which are not subject to the following note. |
||
<br/> |
<br/> |
||
'''Note: Data is stored in big endian byte order regardless of platform.''' |
'''Note: Data is stored in big endian byte order regardless of platform.''' |
||
=== Header === |
=== Header === |
||
Unlike most structures, the header for these assets is not in bytes, but bits. As such, an example is given to aid in understanding the format. |
|||
The offset is replaced with the number of bits, from left to right. |
|||
{| class="wikitable" |
{| class="wikitable" |
||
! |
! Offset (bits) !! Length (bits) !! Constant Name !! Description !! Comments |
||
|- |
|- |
||
| 0 || 4 || SNDPLAYER_VERSION_BITS || Version number || 0 in Burnout |
| 0 || 4 || SNDPLAYER_VERSION_BITS || Version number || 0 in Burnout |
||
|- |
|- |
||
| 4 || 4 || SNDPLAYER_CODEC_BITS || Codec || See [[#EA::Audio::Core::SndPlayerCodec |
| 4 || 4 || SNDPLAYER_CODEC_BITS || Codec || See [[#EA::Audio::Core::SndPlayerCodec|SndPlayerCodec]] |
||
|- |
|- |
||
| 8 || 6 || SNDPLAYER_NUMCHANNELS_BITS || Number of channels || Offset by 1 such that 0 = 1, 1 = 2, etc. |
| 8 || 6 || SNDPLAYER_NUMCHANNELS_BITS || Number of channels || Offset by 1 such that 0 = 1, 1 = 2, etc. |
||
Line 37: | Line 44: | ||
| 14 || 18 || SNDPLAYER_SAMPLERATE_BITS || Sample rate || Expected maximum of 192 kHz but can hold up to 262 kHz |
| 14 || 18 || SNDPLAYER_SAMPLERATE_BITS || Sample rate || Expected maximum of 192 kHz but can hold up to 262 kHz |
||
|- |
|- |
||
| 32 || 2 || SNDPLAYER_PLAYTYPE_BITS || Play type || See [[#EA::Audio::Core::SndPlayerPlayType |
| 32 || 2 || SNDPLAYER_PLAYTYPE_BITS || Play type || See [[#EA::Audio::Core::SndPlayerPlayType|SndPlayerPlayType]] |
||
|- |
|- |
||
| 34 || 1 || SNDPLAYER_LOOPFLAG_BITS || Sets whether the asset is looped || |
| 34 || 1 || SNDPLAYER_LOOPFLAG_BITS || Sets whether the asset is looped || |
||
Line 48: | Line 55: | ||
|- |
|- |
||
| || 32 || SNDPLAYER_STREAM_OFFSET_LOOPSTART_BITS || Loop start offset in stream portion (SNS) || '''Optional.''' Exists only if loop flag is 1 and loop start is in stream portion. |
| || 32 || SNDPLAYER_STREAM_OFFSET_LOOPSTART_BITS || Loop start offset in stream portion (SNS) || '''Optional.''' Exists only if loop flag is 1 and loop start is in stream portion. |
||
⚫ | |||
==== Example header ==== |
|||
This represents a typical stream with no additional fields used. |
|||
{| class="wikitable" |
|||
|+ Hex: 05 04 BB 80 40 07 80 AA |
|||
! Bit value !! 0 !! 0 !! 0 !! 0 !! 0 !! 1 !! 0 !! 1 !! 0 !! 0 !! 0 !! 0 !! 0 !! 1 !! 0 !! 0 !! 1 !! 0 !! 1 !! 1 !! 1 !! 0 !! 1 !! 1 !! 1 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 |
|||
⚫ | |||
| '''Parsed value''' || colspan=4|0 || colspan=4|5 || colspan=6|1 || colspan=18|48000 |
|||
|- |
|||
| '''Description''' || colspan=4|Version 0 || colspan=4|EALayer3 codec || colspan=6|2 channels (stereo) || colspan=18|48 KHz sample rate |
|||
|} |
|||
{| class="wikitable" |
|||
! rowspan=3|(cont.) !! 0 !! 1 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 1 !! 1 !! 1 !! 1 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 0 !! 1 !! 0 !! 1 !! 0 !! 1 !! 0 !! 1 !! 0 |
|||
|- |
|||
| colspan=2|1 || 0 || colspan=29|491690 |
|||
|- |
|||
| colspan=2|Stream play type || Not looped || colspan=29|491690 total samples |
|||
|} |
|} |
||
=== Chunk === |
=== Chunk === |
||
{| class="wikitable" |
{| class="wikitable" |
||
! Offset !! |
! Offset !! Length !! Type !! Name !! Description !! Comments |
||
|- |
|- |
||
| 0x0 || 0x4 || unsigned int || bytes || Number of bytes in the chunk || |
| 0x0 || 0x4 || unsigned int || bytes || Number of bytes in the chunk || |
||
Line 62: | Line 89: | ||
=== EA::Audio::Core::SndPlayerCodec === |
=== EA::Audio::Core::SndPlayerCodec === |
||
{| class="wikitable" |
{| class="wikitable" |
||
⚫ | |||
! Name !! Value !! Comments |
! Name !! Value !! Comments |
||
|- |
|- |
||
Line 102: | Line 128: | ||
=== EA::Audio::Core::SndPlayerPlayType === |
=== EA::Audio::Core::SndPlayerPlayType === |
||
{| class="wikitable" |
{| class="wikitable" |
||
⚫ | |||
! Name !! Value !! Comments |
! Name !! Value !! Comments |
||
|- |
|- |
Latest revision as of 04:07, 4 October 2023
GenericRwacWaveContent | |
---|---|
aka Generic Wave Content | |
Type ID | 0xA020 |
Category | Sound |
Memory distribution |
SNR in Main Memory Audio data in secondary |
Editor available? |
Yes* *EALayer3 codecs only Use EALayer3 |
Sometimes referred to as simply as waves, the Generic RWAC Wave Content resource type is a container for the EA SndPlayer Plug-In Asset. This is the primary sound asset type used throughout the game.
For reference, RWAC (RenderWare Audio Core) is the audio library used by Burnout Paradise and other EA games.
Generating assets
Waves can be generated (without a Binary File header) by the EA Sound Exchange command-line tool. For more information on specifics, see Sounds (Burnout Paradise).
Codec
As noted in the enumeration, there are several codecs to choose from when encoding. Burnout primarily uses EALayer3, a proprietary offshoot of MPEG Layer 3, or its Spike variant. It also uses XAS certain engine sounds, namely ignition, for reasons unknown. The Xbox 360 version uses EA-XMA for all audio except acceleration/deceleration, which is done with Ginsu resources.
Play location
Three play locations are supported: RAM, stream, and gigasample. RAM-targeted assets are self-contained and generally found in engines, splicers, and AEMS banks, while streams have data separate from the header and stored in persistent memory instead of RAM. Gigasamples are like streams, but with a portion in RAM so slow access times on the stream portion do not slow initial playback of the asset.
Loops
When loops are enabled with the -loops
(loop start) option, the loop flag is toggled and the specified sample is written to the header. -loope
(loop end) may also be specified, though it is unclear where this is stored.
Data
In these assets, sound data is stored in chunks to be loaded, played, and unloaded in sequence. This is done to minimize RAM usage and increase streaming efficiency. All other data is that of the sound itself.
Structures
Note: Waves begin with a Binary File resource which are not subject to the following note.
Note: Data is stored in big endian byte order regardless of platform.
Header
Offset (bits) | Length (bits) | Constant Name | Description | Comments |
---|---|---|---|---|
0 | 4 | SNDPLAYER_VERSION_BITS | Version number | 0 in Burnout |
4 | 4 | SNDPLAYER_CODEC_BITS | Codec | See SndPlayerCodec |
8 | 6 | SNDPLAYER_NUMCHANNELS_BITS | Number of channels | Offset by 1 such that 0 = 1, 1 = 2, etc. |
14 | 18 | SNDPLAYER_SAMPLERATE_BITS | Sample rate | Expected maximum of 192 kHz but can hold up to 262 kHz |
32 | 2 | SNDPLAYER_PLAYTYPE_BITS | Play type | See SndPlayerPlayType |
34 | 1 | SNDPLAYER_LOOPFLAG_BITS | Sets whether the asset is looped | |
35 | 29 | SNDPLAYER_NUMSAMPLES_BITS | Total samples in the asset | |
32 | SNDPLAYER_LOOPSTART_BITS | Loop start sample | Optional. Exists only if loop flag is 1 | |
32 | SNDPLAYER_GIGA_RESIDENT_NUMSAMPLES_BITS | Total samples in RAM portion (SNR) | Optional. Exists only if play type is gigasample. | |
32 | SNDPLAYER_STREAM_OFFSET_LOOPSTART_BITS | Loop start offset in stream portion (SNS) | Optional. Exists only if loop flag is 1 and loop start is in stream portion. |
Example header
This represents a typical stream with no additional fields used.
Bit value | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parsed value | 0 | 5 | 1 | 48000 | ||||||||||||||||||||||||||||
Description | Version 0 | EALayer3 codec | 2 channels (stereo) | 48 KHz sample rate |
(cont.) | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | 491690 | ||||||||||||||||||||||||||||||
Stream play type | Not looped | 491690 total samples |
Chunk
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | unsigned int | bytes | Number of bytes in the chunk | |
0x4 | 0x4 | unsigned int | samples | Number of samples in the chunk |
Enumerations
EA::Audio::Core::SndPlayerCodec
Name | Value | Comments |
---|---|---|
SNDPLAYER_CODEC_XAS_INT | 0 | |
SNDPLAYER_CODEC_EALAYER3_INT | 1 | |
SNDPLAYER_CODEC_SIGN16BIG_INT | 2 | |
SNDPLAYER_CODEC_EAXMA | 3 | |
SNDPLAYER_CODEC_XAS1_INT | 4 | |
SNDPLAYER_CODEC_EALAYER31_INT | 5 | |
SNDPLAYER_CODEC_EALAYER32PCM_INT | 6 | |
SNDPLAYER_CODEC_EALAYER32SPIKE_INT | 7 | |
SNDPLAYER_CODEC_GCADPCM | 8 | |
SNDPLAYER_CODEC_EASPEEX | 9 | |
SNDPLAYER_CODEC_ATRAC9 | 10 | |
SNDPLAYER_CODEC_EAMP3 | 11 | |
SNDPLAYER_CODEC_EAOPUS | 12 | |
SNDPLAYER_CODEC_EAATRAC9 | 13 | |
SNDPLAYER_CODEC_MULTISTREAMOPUS | 14 | |
SNDPLAYER_CODEC_MULTISTREAMOPUSUNCOUPLED | 15 | |
SNDPLAYER_CODEC_MAX | 16 |
EA::Audio::Core::SndPlayerPlayType
Name | Value | Comments |
---|---|---|
SNDPLAYER_PLAYTYPE_RAM | 0 | |
SNDPLAYER_PLAYTYPE_STREAM | 1 | |
SNDPLAYER_PLAYTYPE_GIGASAMPLE | 2 | |
SNDPLAYER_PLAYTYPE_MAX | 3 |