blob: 5d114359863286c8e8d218de1dba08653561f02d [file] [log] [blame]
Mikhail Naganov159260c2020-07-23 18:08:26 +00001/*
2 * Copyright (C) 2020 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
17package android.hardware.audio.effect@7.0;
18
19import android.hardware.audio.common@7.0;
20import IEffect;
21
22interface IVirtualizerEffect extends IEffect {
23 /**
24 * Returns whether setting virtualization strength is supported.
25 */
26 isStrengthSupported() generates (bool strengthSupported);
27
28 enum StrengthRange : uint16_t {
29 MIN = 0,
30 MAX = 1000
31 };
32
33 /**
34 * Sets virtualization strength.
35 *
36 * @param strength strength of the effect. The valid range for strength
37 * strength is [0, 1000], where 0 per mille designates the
38 * mildest effect and 1000 per mille designates the
39 * strongest.
40 * @return retval operation completion status.
41 */
42 setStrength(uint16_t strength) generates (Result retval);
43
44 /**
45 * Gets virtualization strength.
46 */
47 getStrength() generates (Result retval, uint16_t strength);
48
Mikhail Naganov9036eda2020-12-10 18:47:51 -080049 struct SpeakerAngles {
Mikhail Naganov159260c2020-07-23 18:08:26 +000050 /** Speaker channel mask */
Mikhail Naganov9036eda2020-12-10 18:47:51 -080051 AudioChannelMask mask;
52 /**
53 * Horizontal speaker position angles for each channel ordered from LSb
54 * to MSb in the channel mask. The number of values is the number of
55 * channels in the channel mask.
56 *
57 * All angles are expressed in degrees and are relative to the listener.
58 * - 0 is the direction the listener faces;
59 * - 180 is behind the listener;
60 * - -90 is to their left.
61 */
62 vec<int16_t> azimuth;
63 /**
64 * Vertical speaker position angles for each channel ordered from LSb
65 * to MSb in the channel mask. The number of values is the number of
66 * channels in the channel mask.
67 *
68 * All angles are expressed in degrees and are relative to the listener.
69 * - 0 is the horizontal plane of the listener;
70 * - +90 is above the listener;
71 * - -90 is below the listener.
72 */
73 vec<int16_t> elevation;
Mikhail Naganov159260c2020-07-23 18:08:26 +000074 };
75 /**
76 * Retrieves virtual speaker angles for the given channel mask on the
77 * specified device.
78 */
Mikhail Naganov9036eda2020-12-10 18:47:51 -080079 getVirtualSpeakerAngles(AudioChannelMask mask, DeviceAddress device)
80 generates (Result retval, SpeakerAngles speakerAngles);
Mikhail Naganov159260c2020-07-23 18:08:26 +000081
82 /**
83 * Forces the virtualizer effect for the given output device.
84 */
Mikhail Naganov7dd87f42020-08-04 23:37:05 +000085 forceVirtualizationMode(DeviceAddress device) generates (Result retval);
Mikhail Naganov159260c2020-07-23 18:08:26 +000086
87 /**
88 * Returns audio device reflecting the current virtualization mode,
Mikhail Naganov7dd87f42020-08-04 23:37:05 +000089 * Device type can be empty when not virtualizing.
Mikhail Naganov159260c2020-07-23 18:08:26 +000090 */
Mikhail Naganov7dd87f42020-08-04 23:37:05 +000091 getVirtualizationMode() generates (Result retval, DeviceAddress device);
Mikhail Naganov159260c2020-07-23 18:08:26 +000092};