blob: e121e1216031f15fcbfcdad813d2b1d742499c12 [file] [log] [blame]
crogers@google.com190f7f42010-09-03 19:24:20 +00001/*
2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
mjs@apple.com92047332014-03-15 04:08:27 +000013 * 3. Neither the name of Apple Inc. ("Apple") nor the names of
crogers@google.com190f7f42010-09-03 19:24:20 +000014 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
commit-queue@webkit.orga4d60d12012-10-12 11:44:58 +000029[
zandobersek@gmail.comc9749912013-10-06 19:01:38 +000030 Conditional=WEB_AUDIO,
commit-queue@webkit.org5eaee512022-02-16 17:27:51 +000031 EnabledBySetting=WebAudioEnabled,
weinig@apple.com6c01c442020-10-01 00:15:51 +000032 Exposed=Window
commit-queue@webkit.orga4d60d12012-10-12 11:44:58 +000033] interface AudioParam {
cdumez@apple.com5087d8a2020-08-28 21:27:28 +000034 [ImplementedAs=valueForBindings] attribute float value;
abarth@webkit.org5817c122011-06-27 06:49:16 +000035
cdumez@apple.com5d6a7af2020-08-20 23:14:05 +000036 attribute AutomationRate automationRate;
crogers@google.com190f7f42010-09-03 19:24:20 +000037
cdumez@apple.com4485b462020-08-10 19:29:03 +000038 readonly attribute float defaultValue;
39 readonly attribute float minValue;
40 readonly attribute float maxValue;
abarth@webkit.org5817c122011-06-27 06:49:16 +000041
commit-queue@webkit.orgcab10ce2012-10-12 06:10:17 +000042 // Parameter automation.
weinig@apple.comc3d7b502021-03-23 00:49:01 +000043 AudioParam setValueAtTime(float value, double startTime);
44 AudioParam linearRampToValueAtTime(float value, double endTime);
45 AudioParam exponentialRampToValueAtTime(float value, double endTime);
crogers@google.comc55a4372011-06-03 19:17:31 +000046
crogers@google.coma5fbe7d2012-10-23 22:11:31 +000047 // Exponentially approach the target with a rate having the given time constant.
weinig@apple.comc3d7b502021-03-23 00:49:01 +000048 AudioParam setTargetAtTime(float target, double startTime, float timeConstant);
crogers@google.comc55a4372011-06-03 19:17:31 +000049
commit-queue@webkit.orgcab10ce2012-10-12 06:10:17 +000050 // Sets an array of arbitrary parameter values starting at time for the given duration.
51 // The number of values will be scaled to fit into the desired duration.
weinig@apple.comc3d7b502021-03-23 00:49:01 +000052 AudioParam setValueCurveAtTime(sequence<float> values, double startTime, double duration);
abarth@webkit.org5817c122011-06-27 06:49:16 +000053
commit-queue@webkit.orgcab10ce2012-10-12 06:10:17 +000054 // Cancels all scheduled parameter changes with times greater than or equal to startTime.
weinig@apple.comc3d7b502021-03-23 00:49:01 +000055 AudioParam cancelScheduledValues(double cancelTime);
56 AudioParam cancelAndHoldAtTime(double cancelTime);
commit-queue@webkit.orgcab10ce2012-10-12 06:10:17 +000057};