1<?xml version="1.0" encoding="utf-8"?> 2<!-- Copyright (C) 2017 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15--> 16<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 17 targetNamespace="http://schemas.android.com/audio/audio_effects_conf/v2_0" 18 xmlns:aec="http://schemas.android.com/audio/audio_effects_conf/v2_0" 19 elementFormDefault="qualified"> 20 21 <!-- Simple types --> 22 <xs:simpleType name="versionType"> 23 <xs:restriction base="xs:decimal"> 24 <xs:enumeration value="2.0"/> 25 </xs:restriction> 26 </xs:simpleType> 27 <xs:simpleType name="uuidType"> 28 <xs:restriction base="xs:string"> 29 <xs:pattern value="[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}"/> 30 </xs:restriction> 31 </xs:simpleType> 32 <xs:simpleType name="streamInputType"> 33 <xs:restriction base="xs:string"> 34 <xs:enumeration value="mic"/> 35 <xs:enumeration value="voice_uplink"/> 36 <xs:enumeration value="voice_downlink"/> 37 <xs:enumeration value="voice_call"/> 38 <xs:enumeration value="camcorder"/> 39 <xs:enumeration value="voice_recognition"/> 40 <xs:enumeration value="voice_communication"/> 41 <xs:enumeration value="unprocessed"/> 42 <xs:enumeration value="voice_performance"/> 43 </xs:restriction> 44 </xs:simpleType> 45 <xs:simpleType name="streamOutputType"> 46 <xs:restriction base="xs:string"> 47 <xs:enumeration value="voice_call"/> 48 <xs:enumeration value="system"/> 49 <xs:enumeration value="ring"/> 50 <xs:enumeration value="music"/> 51 <xs:enumeration value="alarm"/> 52 <xs:enumeration value="notification"/> 53 <xs:enumeration value="bluetooth_sco"/> 54 <xs:enumeration value="enforced_audible"/> 55 <xs:enumeration value="dtmf"/> 56 <xs:enumeration value="tts"/> 57 </xs:restriction> 58 </xs:simpleType> 59 <xs:simpleType name="relativePathType"> 60 <xs:restriction base="xs:string"> 61 <xs:pattern value="[^/].*"/> 62 </xs:restriction> 63 </xs:simpleType> 64 65 <!-- Complex types --> 66 <xs:complexType name="librariesType"> 67 <xs:annotation> 68 <xs:documentation xml:lang="en"> 69 List of effect libraries to load. Each library element must have "name" and 70 "path" attributes. The latter is giving the path of the library .so file 71 relative to the standard effect folders: /(vendor|odm|system)/lib(64)?/soundfx/ 72 73 Example for a library in "/vendor/lib/soundfx/lib.so": 74 <library name="name" path="lib.so"/> 75 76 </xs:documentation> 77 </xs:annotation> 78 <xs:sequence> 79 <xs:element name="library" minOccurs="0" maxOccurs="unbounded"> 80 <xs:complexType> 81 <xs:attribute name="name" type="xs:string" use="required"/> 82 <xs:attribute name="path" type="aec:relativePathType" use="required"/> 83 </xs:complexType> 84 </xs:element> 85 </xs:sequence> 86 </xs:complexType> 87 <xs:complexType name="effectImplType"> 88 <xs:attribute name="library" type="xs:string" use="required"/> 89 <xs:attribute name="uuid" type="aec:uuidType" use="required"/> 90 </xs:complexType> 91 <xs:complexType name="effectType"> 92 <xs:complexContent> 93 <xs:extension base="aec:effectImplType"> 94 <xs:attribute name="name" type="xs:string" use="required"/> 95 </xs:extension> 96 </xs:complexContent> 97 </xs:complexType> 98 <xs:complexType name="effectProxyType"> 99 <xs:complexContent> 100 <xs:extension base="aec:effectType"> 101 <xs:sequence> 102 <xs:element name="libsw" type="aec:effectImplType"/> 103 <xs:element name="libhw" type="aec:effectImplType"/> 104 </xs:sequence> 105 </xs:extension> 106 </xs:complexContent> 107 </xs:complexType> 108 <xs:complexType name="effectsType"> 109 <xs:annotation> 110 <xs:documentation xml:lang="en"> 111 List of effects to load. Each effect element must contain "name", 112 "library", and "uuid" attrs. The value of the "library" attr must 113 correspond to the name of a "library" element. The name of the effect 114 element is indicative, only the value of the "uuid" element designates 115 the effect for the audio framework. The uuid is the implementation 116 specific UUID as specified by the effect vendor. This is not the generic 117 effect type UUID. 118 119 For effect proxy implementations, SW and HW implemetations of the effect 120 can be specified. 121 122 Example: 123 124 <effect name="name" library="lib" uuid="uuuu"/> 125 <effectProxy name="proxied" library="proxy" uuid="xxxx"> 126 <libsw library="sw_bundle" uuid="yyyy"/> 127 <libhw library="offload_bundle" uuid="zzzz"/> 128 </effectProxy> 129 130 </xs:documentation> 131 </xs:annotation> 132 <xs:choice maxOccurs="unbounded"> 133 <xs:element name="effect" type="aec:effectType" minOccurs="0" maxOccurs="unbounded"/> 134 <xs:element name="effectProxy" type="aec:effectProxyType" minOccurs="0" maxOccurs="unbounded"/> 135 </xs:choice> 136 </xs:complexType> 137 <xs:complexType name="streamProcessingType"> 138 <xs:sequence> 139 <xs:element name="apply" minOccurs="0" maxOccurs="unbounded"> 140 <xs:complexType> 141 <xs:attribute name="effect" type="xs:string" use="required"/> 142 </xs:complexType> 143 </xs:element> 144 </xs:sequence> 145 </xs:complexType> 146 <xs:complexType name="streamPreprocessType"> 147 <xs:annotation> 148 <xs:documentation xml:lang="en"> 149 Audio preprocessing configuration. The processing configuration consists 150 of a list of elements each describing processing settings for a given 151 input stream. Valid input stream types are listed in "streamInputType". 152 153 Each stream element contains a list of "apply" elements. The value of the 154 "effect" attr must correspond to the name of an "effect" element. 155 156 Example: 157 158 <stream type="voice_communication"> 159 <apply effect="effect1"/> 160 <apply effect="effect2"/> 161 </stream> 162 163 </xs:documentation> 164 </xs:annotation> 165 <xs:complexContent> 166 <xs:extension base="aec:streamProcessingType"> 167 <xs:attribute name="type" type="aec:streamInputType" use="required"/> 168 </xs:extension> 169 </xs:complexContent> 170 </xs:complexType> 171 <xs:complexType name="streamPostprocessType"> 172 <xs:annotation> 173 <xs:documentation xml:lang="en"> 174 Audio postprocessing configuration. The processing configuration consists 175 of a list of elements each describing processing settings for a given 176 output stream. Valid output stream types are listed in "streamOutputType". 177 178 Each stream element contains a list of "apply" elements. The value of the 179 "effect" attr must correspond to the name of an "effect" element. 180 181 Example: 182 183 <stream type="music"> 184 <apply effect="effect1"/> 185 </stream> 186 187 </xs:documentation> 188 </xs:annotation> 189 <xs:complexContent> 190 <xs:extension base="aec:streamProcessingType"> 191 <xs:attribute name="type" type="aec:streamOutputType" use="required"/> 192 </xs:extension> 193 </xs:complexContent> 194 </xs:complexType> 195 196 <!-- Root element --> 197 <xs:element name="audio_effects_conf"> 198 <xs:complexType> 199 <xs:sequence> 200 <xs:element name="libraries" type="aec:librariesType"/> 201 <xs:element name="effects" type="aec:effectsType"/> 202 <xs:element name="postprocess" minOccurs="0" maxOccurs="1"> 203 <xs:complexType> 204 <xs:sequence> 205 <xs:element name="stream" type="aec:streamPostprocessType" minOccurs="0" maxOccurs="unbounded"/> 206 </xs:sequence> 207 </xs:complexType> 208 </xs:element> 209 <xs:element name="preprocess" minOccurs="0" maxOccurs="1"> 210 <xs:complexType> 211 <xs:sequence> 212 <xs:element name="stream" type="aec:streamPreprocessType" minOccurs="0" maxOccurs="unbounded"/> 213 </xs:sequence> 214 </xs:complexType> 215 </xs:element> 216 </xs:sequence> 217 <xs:attribute name="version" type="aec:versionType" use="required"/> 218 </xs:complexType> 219 220 <!-- Keys and references --> 221 <xs:key name="libraryName"> 222 <xs:selector xpath="aec:libraries/aec:library"/> 223 <xs:field xpath="@name"/> 224 </xs:key> 225 <xs:keyref name="libraryNameRef1" refer="aec:libraryName"> 226 <xs:selector xpath="aec:effects/aec:effect"/> 227 <xs:field xpath="@library"/> 228 </xs:keyref> 229 <xs:keyref name="libraryNameRef2" refer="aec:libraryName"> 230 <xs:selector xpath="aec:effects/aec:effect/aec:libsw"/> 231 <xs:field xpath="@library"/> 232 </xs:keyref> 233 <xs:keyref name="libraryNameRef3" refer="aec:libraryName"> 234 <xs:selector xpath="aec:effects/aec:effect/aec:libhw"/> 235 <xs:field xpath="@library"/> 236 </xs:keyref> 237 <xs:key name="effectName"> 238 <xs:selector xpath="aec:effects/aec:effect|aec:effects/aec:effectProxy"/> 239 <xs:field xpath="@name"/> 240 </xs:key> 241 <xs:keyref name="effectNamePreRef" refer="aec:effectName"> 242 <xs:selector xpath="aec:preprocess/aec:stream/aec:apply"/> 243 <xs:field xpath="@effect"/> 244 </xs:keyref> 245 <xs:keyref name="effectNamePostRef" refer="aec:effectName"> 246 <xs:selector xpath="aec:postprocess/aec:stream/aec:apply"/> 247 <xs:field xpath="@effect"/> 248 </xs:keyref> 249 </xs:element> 250</xs:schema> 251