blob: 52038ca08cbd4fe05e651df6f43db748fae69142 [file] [log] [blame]
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -08001/*
2 * Copyright (C) 2018 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@4.0;
18
19import android.hardware.audio.common@4.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
49 struct SpeakerAngle {
Kevin Rocard79c57402018-01-24 10:02:30 -080050 /** Speaker channel mask */
51 bitfield<AudioChannelMask> mask;
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080052 // all angles are expressed in degrees and
53 // are relative to the listener.
54 int16_t azimuth; // 0 is the direction the listener faces
55 // 180 is behind the listener
56 // -90 is to their left
57 int16_t elevation; // 0 is the horizontal plane
58 // +90 is above the listener, -90 is below
59 };
60 /**
61 * Retrieves virtual speaker angles for the given channel mask on the
62 * specified device.
63 */
Kevin Rocard79c57402018-01-24 10:02:30 -080064 getVirtualSpeakerAngles(bitfield<AudioChannelMask> mask, AudioDevice device)
Kevin Rocarda4e6d8b2018-01-20 21:52:01 -080065 generates (Result retval, vec<SpeakerAngle> speakerAngles);
66
67 /**
68 * Forces the virtualizer effect for the given output device.
69 */
70 forceVirtualizationMode(AudioDevice device) generates (Result retval);
71
72 /**
73 * Returns audio device reflecting the current virtualization mode,
74 * AUDIO_DEVICE_NONE when not virtualizing.
75 */
76 getVirtualizationMode() generates (Result retval, AudioDevice device);
77};