AssetTypeAudio.xsd 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="uri:ea.com:eala:asset" xmlns:at="uri:ea.com:eala:asset:type" xmlns:xas="uri:ea.com:eala:asset:schema" targetNamespace="uri:ea.com:eala:asset" elementFormDefault="qualified" xmlns:XmlEdit="http://tempuri.org/XmlEdit.xsd">
  3. <!-- Way the pipeline should compress the data when writing PC data... -->
  4. <xs:simpleType name="PCAudioCompressionSetting">
  5. <xs:restriction base="xs:string">
  6. <xs:enumeration value="NONE" /> <!-- No compression -->
  7. <xs:enumeration value="XAS" /> <!-- XAS on PC (IMA ADPCM - like) -->
  8. <xs:enumeration value="EALAYER3" /> <!-- EALayer3 compression (much like MP3) -->
  9. </xs:restriction>
  10. </xs:simpleType>
  11. <xs:simpleType name="XenonAudioCompressionSetting">
  12. <xs:restriction base="xs:string">
  13. <xs:enumeration value="NONE" /> <!-- No compression -->
  14. <xs:enumeration value="XMA" /> <!-- XMA (360's special built-in compression type) -->
  15. <xs:enumeration value="EALAYER3" /> <!-- EALayer3 compression (much like MP3) -->
  16. </xs:restriction>
  17. </xs:simpleType>
  18. <xs:simpleType name="PS3AudioCompressionSetting">
  19. <xs:restriction base="xs:string">
  20. <xs:enumeration value="XAS" /> <!-- XAS compression -->
  21. <xs:enumeration value="EALAYER3" /> <!-- EALayer3 compression (much like MP3) -->
  22. </xs:restriction>
  23. </xs:simpleType>
  24. <!-- Audio file in the built data -->
  25. <xs:complexType name="AudioFileRuntime" xas:runtimeWrapper="::AudioFileInfo" xas:typeGroup="Xml">
  26. <xs:complexContent>
  27. <xs:extension base="BaseAssetType">
  28. <xs:sequence />
  29. <xs:attribute name="SubtitleStringName" type="xs:string" use="required" />
  30. <xs:attribute name="NumberOfChannels" type="xs:unsignedByte" use="required" />
  31. <xs:attribute name="NumberOfSamples" type="SageInt" use="required" />
  32. <xs:attribute name="SampleRate" type="SageInt" use="required" />
  33. <xs:attribute name="HeaderData" type="SageInt" use="required" />
  34. <!-- This will actually be a void * through the magic of xsd2cpp\[platform].config.xml -->
  35. <xs:attribute name="HeaderDataSize" type="SageInt" use="required" />
  36. </xs:extension>
  37. </xs:complexContent>
  38. </xs:complexType>
  39. <!-- Audio file in the XML. Corresponds to 1 .wav file -->
  40. <xs:complexType name="AudioFile" xas:runtimeWrapper="::AudioFileInfo" xas:typeGroup="Audio">
  41. <xs:complexContent>
  42. <xs:extension base="BaseAssetType">
  43. <xs:sequence />
  44. <xs:attribute name="File" type="FileReference" use="required" />
  45. <xs:attribute name="PCSampleRate" type="SageInt" use="optional" />
  46. <xs:attribute name="PCCompression" type="PCAudioCompressionSetting" use="optional" />
  47. <xs:attribute name="PCQuality" type="SageInt" default="75" /> <!-- For EALAYER3 compression: How good is the compression? 0 = high compression, low quality. 100 = little compression, high quality -->
  48. <xs:attribute name="IsStreamedOnPC" type="SageBool" use="optional" />
  49. <xs:attribute name="XenonSampleRate" type="SageInt" use="optional" />
  50. <xs:attribute name="XenonCompression" type="XenonAudioCompressionSetting" use="optional" />
  51. <xs:attribute name="XenonQuality" type="SageInt" default="75" /> <!-- For EALAYER3 and XMA compression: How good is the compression? 0 = high compression, low quality. 100 = little compression, high quality -->
  52. <xs:attribute name="IsStreamedOnXenon" type="SageBool" use="optional" />
  53. <xs:attribute name="PS3SampleRate" type="SageInt" use="optional" />
  54. <xs:attribute name="PS3Compression" type="PS3AudioCompressionSetting" use="optional" />
  55. <xs:attribute name="PS3Quality" type="SageInt" default="75" /> <!-- For EALAYER3 compression: How good is the compression? 0 = high compression, low quality. 100 = little compression, high quality -->
  56. <xs:attribute name="IsStreamedOnPS3" type="SageBool" use="optional" />
  57. <xs:attribute name="SubtitleStringName" type="xs:string" use="optional" />
  58. <xs:attribute name="GUIPreset" type="xs:string" use="optional" /> <!-- If this was created by the Audio Asset Processor using a Preset, the name of the preset. Not used in game, just for later fixup if we need to change a preset -->
  59. </xs:extension>
  60. </xs:complexContent>
  61. </xs:complexType>
  62. <xs:simpleType name="AudioFileRef"
  63. xas:isRef="true"
  64. xas:refType="AudioFile">
  65. <xs:restriction base="AssetReference" />
  66. </xs:simpleType>
  67. <!-- Audio priority enum -->
  68. <xs:simpleType name="AudioPriority">
  69. <xs:restriction base="xs:string">
  70. <xs:enumeration value="LOWEST" />
  71. <xs:enumeration value="LOW" />
  72. <xs:enumeration value="NORMAL" />
  73. <xs:enumeration value="HIGH" />
  74. <xs:enumeration value="HIGHEST" />
  75. <xs:enumeration value="CRITICAL" />
  76. </xs:restriction>
  77. </xs:simpleType>
  78. <!-- Volume sliders -->
  79. <xs:simpleType name="AudioVolumeSlider">
  80. <xs:restriction base="xs:string">
  81. <xs:enumeration value="SOUNDFX" />
  82. <xs:enumeration value="VOICE" />
  83. <xs:enumeration value="MUSIC" />
  84. <xs:enumeration value="AMBIENT" />
  85. <xs:enumeration value="MOVIE" />
  86. <xs:enumeration value="NONE" /> <!-- Yes this is a real slider type - it means we not affected by any of the sliders on the options window -->
  87. </xs:restriction>
  88. </xs:simpleType>
  89. <!-- Volume slider multipliers. A sound can multiply the volume of all sounds which use a slider. This is one such multiplication -->
  90. <xs:complexType name="AudioVolumeSliderMultiplier">
  91. <xs:attribute name="Slider" type="AudioVolumeSlider" use="required" />
  92. <xs:attribute name="Multiplier" type="SageReal" use="required" />
  93. </xs:complexType>
  94. <!-- One possible audio type flag -->
  95. <xs:simpleType name="AudioTypeFlag">
  96. <xs:restriction base="xs:string">
  97. <xs:enumeration value="UI" />
  98. <xs:enumeration value="WORLD" />
  99. <xs:enumeration value="SHROUDED" />
  100. <xs:enumeration value="VOICE" />
  101. <xs:enumeration value="PLAYER" />
  102. <xs:enumeration value="ALLIES" />
  103. <xs:enumeration value="ENEMIES" />
  104. <xs:enumeration value="EVERYONE" />
  105. </xs:restriction>
  106. </xs:simpleType>
  107. <!-- The complete collection of flags. Corresponds to the actual bitfiend in code -->
  108. <xs:simpleType name="AudioTypeFlags">
  109. <xs:list itemType="AudioTypeFlag" />
  110. </xs:simpleType>
  111. <!-- One possible audio control flag -->
  112. <xs:simpleType name="AudioControlFlag">
  113. <xs:restriction base="xs:string">
  114. <xs:enumeration value="LOOP" />
  115. <xs:enumeration value="SEQUENTIAL" />
  116. <xs:enumeration value="RANDOMSTART" />
  117. <xs:enumeration value="INTERRUPT" />
  118. <xs:enumeration value="SMART_LIMITING" />
  119. <xs:enumeration value="FADE_ON_KILL" />
  120. <xs:enumeration value="FADE_ON_START" />
  121. <xs:enumeration value="ALLOW_KILL_MID_FILE" />
  122. <xs:enumeration value="IMMEDIATE_DECAY_ON_KILL" />
  123. </xs:restriction>
  124. </xs:simpleType>
  125. <!-- The complete collection of flags. Corresponds to the actual bitfiend in code -->
  126. <xs:simpleType name="AudioControlFlags">
  127. <xs:list itemType="AudioControlFlag" />
  128. </xs:simpleType>
  129. <!-- Used for Group Limiting feature. Allows us to associate related groups of AudioEvents -->
  130. <xs:complexType name="AudioEventLimitGroup" xas:typeGroup="Xml">
  131. <xs:complexContent>
  132. <xs:extension base="BaseInheritableAsset">
  133. <xs:attribute name="Limit" type="SageInt" use="required"/>
  134. </xs:extension>
  135. </xs:complexContent>
  136. </xs:complexType>
  137. <xs:simpleType name="AudioEventLimitGroupRef" xas:isRef="true" xas:refType="AudioEventLimitGroup">
  138. <xs:restriction base="AssetReference" />
  139. </xs:simpleType>
  140. <!-- The basic type of any sound, be it sound effect, music, speech, ambient, or multisound -->
  141. <xs:complexType name="BaseAudioEventInfo" abstract="true" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  142. <xs:complexContent>
  143. <xs:extension base="BaseInheritableAsset" >
  144. <!-- This type has no actual data. It exists simply because we want multisounds to be used anywhere other
  145. sounds can be, so we need a common basis for multisounds and sound effects (but not other game assets!)
  146. So this is the common basis for both. It lists all the attributes which normal sound effects and
  147. multisounds share - which at the moment is zilch. -->
  148. <xs:sequence></xs:sequence>
  149. </xs:extension>
  150. </xs:complexContent>
  151. </xs:complexType>
  152. <!-- Basis for any single sound (e.g. everything but multisounds) -->
  153. <xs:complexType name="BaseSingleSound" abstract="true" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  154. <xs:complexContent>
  155. <xs:extension base="BaseAudioEventInfo" >
  156. <xs:sequence>
  157. <xs:element name="PitchShift" type="RealRange" minOccurs="0" maxOccurs="1" />
  158. <xs:element name="PerFilePitchShift" type="RealRange" minOccurs="0" maxOccurs="1" />
  159. <xs:element name="Delay" type="IntRange" minOccurs="0" maxOccurs="1" />
  160. <xs:element name="InitialDelay" type="IntRange" minOccurs="0" maxOccurs="1" />
  161. <xs:element name="VolumeSliderMultiplier" type="AudioVolumeSliderMultiplier" minOccurs="0" maxOccurs="unbounded" />
  162. <xs:element name="MinRangeShift" type="RealRange" minOccurs="0" maxOccurs="1" />
  163. <xs:element name="MaxRangeShift" type="RealRange" minOccurs="0" maxOccurs="1" />
  164. <xs:element name="LimitGroup" type="AudioEventLimitGroupRef" minOccurs="0" maxOccurs="unbounded" />
  165. <xs:element name="NonInterruptibleTime" type="TimeRange" minOccurs="0" maxOccurs="1" />
  166. </xs:sequence>
  167. <xs:attribute name="Volume" type="Percentage" default="100" />
  168. <xs:attribute name="VolumeShift" type="Percentage" default="0" />
  169. <xs:attribute name="PerFileVolumeShift" type="Percentage" default="0" />
  170. <xs:attribute name="MinVolume" type="Percentage" default="0" />
  171. <xs:attribute name="ShrunkenPitchModifier" type="SageReal" default="1.0" />
  172. <xs:attribute name="ShrunkenVolumeModifier" type="Percentage" default="100" />
  173. <xs:attribute name="PlayPercent" type="Percentage" default="100" />
  174. <xs:attribute name="Limit" type="SageInt" default="0" />
  175. <xs:attribute name="Priority" type="AudioPriority" default="NORMAL" />
  176. <xs:attribute name="Type" type="AudioTypeFlags" default="" />
  177. <xs:attribute name="Control" type="AudioControlFlags" default="" />
  178. <xs:attribute name="MinRange" type="SageReal" default="160" />
  179. <xs:attribute name="MaxRange" type="SageReal" default="640" />
  180. <xs:attribute name="LowPassCutoff" type="Percentage" default="0" />
  181. <xs:attribute name="ZoomedInOffscreenVolumePercent" type="Percentage" default="50" />
  182. <xs:attribute name="ZoomedInOffscreenMinVolumePercent" type="Percentage" default="100" />
  183. <xs:attribute name="ZoomedInOffscreenOcclusionPercent" type="Percentage" default="20" />
  184. <xs:attribute name="ReverbEffectLevel" type="Percentage" default="0" />
  185. <xs:attribute name="DryLevel" type="Percentage" default="100" />
  186. <xs:attribute name="SubmixSlider" type="AudioVolumeSlider" use="optional" /> <!-- There is a default, but it's a complex calculation -->
  187. </xs:extension>
  188. </xs:complexContent>
  189. </xs:complexType>
  190. <!-- A reference to an .SNR file in one of the Data\Audio\Sounds directories, together with the compression type and the weight (chance of playing) -->
  191. <xs:complexType name="AudioFileRefWithWeight"
  192. xas:isRef="true"
  193. xas:refType="AudioFile">
  194. <xs:simpleContent>
  195. <xs:extension base="AudioFileRef" >
  196. <xs:attribute name="Weight" type="SageUnsignedInt" default="1000" />
  197. <xs:attribute name="Volume" type="Percentage" default="100"/>
  198. </xs:extension>
  199. </xs:simpleContent>
  200. </xs:complexType>
  201. <!-- A reference to an subsound in a multisound -->
  202. <xs:complexType name="MultisoundSubsoundRef" xas:isRef="true" xas:refType="BaseAudioEventInfo">
  203. <xs:simpleContent>
  204. <xs:extension base="AudioEventInfoRef" >
  205. <xs:attribute name="Weight" type="SageUnsignedInt" default="1000" />
  206. <!-- AssetReferences can't contain complex types thus PitchShift has been split into two different parameters here -->
  207. <xs:attribute name="PitchShiftLow" type="SageReal" use="optional" />
  208. <xs:attribute name="PitchShiftHigh" type="SageReal" use="optional" />
  209. <xs:attribute name="Volume" type="Percentage" use="optional" />
  210. <xs:attribute name="PlayPercent" type="Percentage" use="optional" />
  211. <xs:attribute name="VolumeShift" type="Percentage" use="optional" />
  212. </xs:extension>
  213. </xs:simpleContent>
  214. </xs:complexType>
  215. <!-- A non-streamed sound effect -->
  216. <xs:complexType name="AudioEvent" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  217. <xs:complexContent>
  218. <xs:extension base="BaseSingleSound">
  219. <xs:sequence>
  220. <xs:element name="Attack" type="AudioFileRefWithWeight" minOccurs="0" maxOccurs="unbounded" />
  221. <xs:element name="Sound" type="AudioFileRefWithWeight" minOccurs="0" maxOccurs="unbounded" />
  222. <xs:element name="Decay" type="AudioFileRefWithWeight" minOccurs="0" maxOccurs="unbounded" />
  223. </xs:sequence>
  224. </xs:extension>
  225. </xs:complexContent>
  226. </xs:complexType>
  227. <!-- A NON-TRANSIENT version of AudioEvent, so that it can be overridden per-map. Use sparingly! -->
  228. <xs:complexType name="AudioEventOverridable" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  229. <xs:complexContent>
  230. <xs:extension base="AudioEvent">
  231. </xs:extension>
  232. </xs:complexContent>
  233. </xs:complexType>
  234. <!-- A streamed piece of music -->
  235. <xs:complexType name="MusicTrack" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  236. <xs:complexContent>
  237. <xs:extension base="BaseSingleSound">
  238. <xs:sequence>
  239. <xs:element name="Filename" type="AudioFileRef" minOccurs="0" maxOccurs="1" />
  240. </xs:sequence>
  241. </xs:extension>
  242. </xs:complexContent>
  243. </xs:complexType>
  244. <!-- A streamed speech -->
  245. <xs:complexType name="DialogEvent" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  246. <xs:complexContent>
  247. <xs:extension base="BaseSingleSound">
  248. <xs:sequence>
  249. <xs:element name="Filename" type="AudioFileRef" minOccurs="0" maxOccurs="1" />
  250. </xs:sequence>
  251. </xs:extension>
  252. </xs:complexContent>
  253. </xs:complexType>
  254. <!-- An ambient stream -->
  255. <xs:complexType name="AmbientStream" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  256. <xs:complexContent>
  257. <xs:extension base="BaseSingleSound">
  258. <xs:sequence>
  259. <xs:element name="Filename" type="AudioFileRef" minOccurs="0" maxOccurs="1" />
  260. </xs:sequence>
  261. </xs:extension>
  262. </xs:complexContent>
  263. </xs:complexType>
  264. <!-- One possible audio control flag for a multisound -->
  265. <xs:simpleType name="MultisoundControlFlag">
  266. <xs:restriction base="xs:string">
  267. <xs:enumeration value="LOOP" />
  268. <xs:enumeration value="PLAY_ONE" />
  269. </xs:restriction>
  270. </xs:simpleType>
  271. <!-- The complete collection of flags. Corresponds to the actual bitfiend in code -->
  272. <xs:simpleType name="MultisoundControlFlags">
  273. <xs:list itemType="MultisoundControlFlag" />
  274. </xs:simpleType>
  275. <!-- This is just a way of saying that you can't have LOOP without the PLAY_ONE flag. I just haven't
  276. worked around some of the problems with LOOPing several one-shots at the same time, and I don't want
  277. to bother unless I need to... -->
  278. <!-- Bleck can't get this to work with our current build pipeline
  279. <xs:simpleType name="MultisoundControlFlag_Restricted" xas:runtimeWrapper="SageBinaryData::MultisoundControlFlags">
  280. <xs:restriction base="MultisoundControlFlags">
  281. <xs:enumeration value="" />
  282. <xs:enumeration value="PLAY_ONE" />
  283. <xs:enumeration value="LOOP PLAY_ONE" />
  284. <xs:enumeration value="PLAY_ONE LOOP" />
  285. </xs:restriction>
  286. </xs:simpleType> -->
  287. <!-- A sound consisting of several other sounds -->
  288. <xs:complexType name="Multisound" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  289. <xs:complexContent>
  290. <xs:extension base="BaseAudioEventInfo">
  291. <xs:sequence>
  292. <xs:element name="Subsound" type="MultisoundSubsoundRef" minOccurs="0" maxOccurs="unbounded" />
  293. </xs:sequence>
  294. <xs:attribute name="Control" type="MultisoundControlFlags" default="" />
  295. </xs:extension>
  296. </xs:complexContent>
  297. </xs:complexType>
  298. <!-- A NON-TRANSIENT version of Multisound, so that it can be overridden per-map. Use sparingly! -->
  299. <xs:complexType name="MultisoundOverridable" xas:runtimeWrapper="::AudioEventInfo" xas:typeGroup="Xml">
  300. <xs:complexContent>
  301. <xs:extension base="Multisound">
  302. </xs:extension>
  303. </xs:complexContent>
  304. </xs:complexType>
  305. </xs:schema>