Version
menu_open
link
Wwise SDK 2023.1.4
AkWavDefs.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 #pragma once
28 
29 /// \file
30 /// Basic definitions for WAV / WEM file parsers.
31 
34 
35 //-----------------------------------------------------------------------------
36 // Constants.
37 //-----------------------------------------------------------------------------
38 
39 // Standard IDs
40 constexpr AkFourcc RIFXChunkId = AkmmioFOURCC('R', 'I', 'F', 'X');
41 constexpr AkFourcc RIFFChunkId = AkmmioFOURCC('R', 'I', 'F', 'F');
42 constexpr AkFourcc WAVEChunkId = AkmmioFOURCC('W', 'A', 'V', 'E');
43 constexpr AkFourcc PLUGINChunkId = AkmmioFOURCC('P', 'L', 'U', 'G');
44 constexpr AkFourcc MIDIChunkId = AkmmioFOURCC('M', 'I', 'D', 'I');
45 constexpr AkFourcc fmtChunkId = AkmmioFOURCC('f', 'm', 't', ' ');
46 constexpr AkFourcc dataChunkId = AkmmioFOURCC('d', 'a', 't', 'a');
47 constexpr AkFourcc cueChunkId = AkmmioFOURCC('c', 'u', 'e', ' ');
48 constexpr AkFourcc LISTChunkId = AkmmioFOURCC('L', 'I', 'S', 'T');
49 constexpr AkFourcc adtlChunkId = AkmmioFOURCC('a', 'd', 't', 'l');
50 constexpr AkFourcc lablChunkId = AkmmioFOURCC('l', 'a', 'b', 'l');
51 constexpr AkFourcc smplChunkId = AkmmioFOURCC('s', 'm', 'p', 'l');
52 constexpr AkFourcc junkChunkId = AkmmioFOURCC('j', 'u', 'n', 'k');
53 
54 // AK-specific IDs
55 constexpr AkFourcc akdChunkId = AkmmioFOURCC('a', 'k', 'd', ' ');
56 constexpr AkFourcc hashChunkId = AkmmioFOURCC('h', 'a', 's', 'h');
57 constexpr AkFourcc seekChunkId = AkmmioFOURCC('s', 'e', 'e', 'k');
58 constexpr AkFourcc irmdChunkId = AkmmioFOURCC('i', 'r', 'm', 'd');
59 
60 //-----------------------------------------------------------------------------
61 // Structs.
62 //-----------------------------------------------------------------------------
63 
64 #pragma pack(push, 1)
65 
66 /// Standard WAV chunk header
68 {
71 };
72 
73 /// Standard WAV format header
75 {
82  AkUInt16 cbSize; // size of extra chunk of data, after end of this struct
83 };
84 
85 /// WEM format header: equivalent to WAVEFORMATEXTENSIBLE, with an AkChannelConfig
86 /// instead of dwChannelMask+SubFormat. Codecs that require format-specific chunks
87 /// should extend this structure.
89 {
91  AkUInt32 uChannelConfig; // Serialized AkChannelConfig
92 
94  {
95  AkChannelConfig channelConfig;
96  channelConfig.Deserialize(uChannelConfig);
97  return channelConfig;
98  }
99 };
100 static_assert(sizeof(WaveFormatExtensible) == 24, "Incorrect padding for WaveFormatExtensible");
101 
102 #pragma pack(pop)
AkUInt16 nBlockAlign
Definition: AkWavDefs.h:80
constexpr AkFourcc MIDIChunkId
Definition: AkWavDefs.h:44
uint16_t AkUInt16
Unsigned 16-bit integer.
constexpr AkFourcc fmtChunkId
Definition: AkWavDefs.h:45
constexpr AkFourcc hashChunkId
Definition: AkWavDefs.h:56
constexpr AkFourcc dataChunkId
Definition: AkWavDefs.h:46
AkUInt16 wBitsPerSample
Definition: AkWavDefs.h:81
AkUInt16 nChannels
Definition: AkWavDefs.h:77
constexpr AkFourcc cueChunkId
Definition: AkWavDefs.h:47
AkUInt16 wFormatTag
Definition: AkWavDefs.h:76
AkUInt16 wSamplesPerBlock
Definition: AkWavDefs.h:90
AkUInt32 nAvgBytesPerSec
Definition: AkWavDefs.h:79
constexpr AkFourcc junkChunkId
Definition: AkWavDefs.h:52
constexpr AkFourcc RIFXChunkId
Definition: AkWavDefs.h:40
constexpr AkFourcc RIFFChunkId
Definition: AkWavDefs.h:41
AkUInt32 uChannelConfig
Definition: AkWavDefs.h:91
constexpr AkFourcc irmdChunkId
Definition: AkWavDefs.h:58
constexpr AkFourcc PLUGINChunkId
Definition: AkWavDefs.h:43
AkUInt32 dwChunkSize
Definition: AkWavDefs.h:70
constexpr AkFourcc smplChunkId
Definition: AkWavDefs.h:51
constexpr AkFourcc WAVEChunkId
Definition: AkWavDefs.h:42
Standard WAV format header.
Definition: AkWavDefs.h:75
constexpr AkFourcc LISTChunkId
Definition: AkWavDefs.h:48
Standard WAV chunk header.
Definition: AkWavDefs.h:68
constexpr AkFourcc akdChunkId
Definition: AkWavDefs.h:55
AkFourcc ChunkId
Definition: AkWavDefs.h:69
AkUInt16 cbSize
Definition: AkWavDefs.h:82
constexpr AkFourcc seekChunkId
Definition: AkWavDefs.h:57
constexpr AkFourcc lablChunkId
Definition: AkWavDefs.h:50
AkUInt32 nSamplesPerSec
Definition: AkWavDefs.h:78
uint32_t AkUInt32
Unsigned 32-bit integer.
#define AkmmioFOURCC(ch0, ch1, ch2, ch3)
Create Riff chunk.
Definition: AkTypes.h:87
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:84
constexpr AkFourcc adtlChunkId
Definition: AkWavDefs.h:49
AkChannelConfig GetChannelConfig() const
Definition: AkWavDefs.h:93
AkForceInline void Deserialize(AkUInt32 in_uChannelConfig)
Deserialize channel config from a 32-bit word.

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise