crogers@google.com | 190f7f4 | 2010-09-03 19:24:20 +0000 | [diff] [blame] | 1 | /* |
| 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.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 13 | * 3. Neither the name of Apple Inc. ("Apple") nor the names of |
crogers@google.com | 190f7f4 | 2010-09-03 19:24:20 +0000 | [diff] [blame] | 14 | * 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.org | a4d60d1 | 2012-10-12 11:44:58 +0000 | [diff] [blame] | 29 | [ |
zandobersek@gmail.com | c974991 | 2013-10-06 19:01:38 +0000 | [diff] [blame] | 30 | Conditional=WEB_AUDIO, |
commit-queue@webkit.org | 5eaee51 | 2022-02-16 17:27:51 +0000 | [diff] [blame] | 31 | EnabledBySetting=WebAudioEnabled, |
weinig@apple.com | 6c01c44 | 2020-10-01 00:15:51 +0000 | [diff] [blame] | 32 | Exposed=Window |
commit-queue@webkit.org | a4d60d1 | 2012-10-12 11:44:58 +0000 | [diff] [blame] | 33 | ] interface AudioParam { |
cdumez@apple.com | 5087d8a | 2020-08-28 21:27:28 +0000 | [diff] [blame] | 34 | [ImplementedAs=valueForBindings] attribute float value; |
abarth@webkit.org | 5817c12 | 2011-06-27 06:49:16 +0000 | [diff] [blame] | 35 | |
cdumez@apple.com | 5d6a7af | 2020-08-20 23:14:05 +0000 | [diff] [blame] | 36 | attribute AutomationRate automationRate; |
crogers@google.com | 190f7f4 | 2010-09-03 19:24:20 +0000 | [diff] [blame] | 37 | |
cdumez@apple.com | 4485b46 | 2020-08-10 19:29:03 +0000 | [diff] [blame] | 38 | readonly attribute float defaultValue; |
| 39 | readonly attribute float minValue; |
| 40 | readonly attribute float maxValue; |
abarth@webkit.org | 5817c12 | 2011-06-27 06:49:16 +0000 | [diff] [blame] | 41 | |
commit-queue@webkit.org | cab10ce | 2012-10-12 06:10:17 +0000 | [diff] [blame] | 42 | // Parameter automation. |
weinig@apple.com | c3d7b50 | 2021-03-23 00:49:01 +0000 | [diff] [blame] | 43 | AudioParam setValueAtTime(float value, double startTime); |
| 44 | AudioParam linearRampToValueAtTime(float value, double endTime); |
| 45 | AudioParam exponentialRampToValueAtTime(float value, double endTime); |
crogers@google.com | c55a437 | 2011-06-03 19:17:31 +0000 | [diff] [blame] | 46 | |
crogers@google.com | a5fbe7d | 2012-10-23 22:11:31 +0000 | [diff] [blame] | 47 | // Exponentially approach the target with a rate having the given time constant. |
weinig@apple.com | c3d7b50 | 2021-03-23 00:49:01 +0000 | [diff] [blame] | 48 | AudioParam setTargetAtTime(float target, double startTime, float timeConstant); |
crogers@google.com | c55a437 | 2011-06-03 19:17:31 +0000 | [diff] [blame] | 49 | |
commit-queue@webkit.org | cab10ce | 2012-10-12 06:10:17 +0000 | [diff] [blame] | 50 | // 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.com | c3d7b50 | 2021-03-23 00:49:01 +0000 | [diff] [blame] | 52 | AudioParam setValueCurveAtTime(sequence<float> values, double startTime, double duration); |
abarth@webkit.org | 5817c12 | 2011-06-27 06:49:16 +0000 | [diff] [blame] | 53 | |
commit-queue@webkit.org | cab10ce | 2012-10-12 06:10:17 +0000 | [diff] [blame] | 54 | // Cancels all scheduled parameter changes with times greater than or equal to startTime. |
weinig@apple.com | c3d7b50 | 2021-03-23 00:49:01 +0000 | [diff] [blame] | 55 | AudioParam cancelScheduledValues(double cancelTime); |
| 56 | AudioParam cancelAndHoldAtTime(double cancelTime); |
commit-queue@webkit.org | cab10ce | 2012-10-12 06:10:17 +0000 | [diff] [blame] | 57 | }; |