AudioParam.hx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (C)2005-2018 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\AudioParam.webidl. Do not edit!
  23. package js.html.audio;
  24. /**
  25. There are two kinds of `AudioParam`, a-rate and k-rate parameters:
  26. Documentation [AudioParam](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/AudioParam$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/AudioParam>
  28. **/
  29. @:native("AudioParam")
  30. extern class AudioParam
  31. {
  32. /**
  33. Represents the parameter's current volume as a floating point value; initially set to the value of `AudioParam.defaultValue`. Though it can be set, any modifications happening while there are automation events scheduled — that is events scheduled using the methods of the `AudioParam` — are ignored, without raising any exception.
  34. **/
  35. var value : Float;
  36. /**
  37. Represents the initial volume of the attribute as defined by the specific `AudioNode` creating the `AudioParam`.
  38. **/
  39. var defaultValue(default,null) : Float;
  40. /** @throws DOMError */
  41. /**
  42. Schedules an instant change to the value of the `AudioParam` at a precise time, as measured against `AudioContext.currentTime`. The new value is given in the `value` parameter.
  43. **/
  44. function setValueAtTime( value : Float, startTime : Float ) : Void;
  45. /** @throws DOMError */
  46. /**
  47. Schedules a gradual linear change in the value of the `AudioParam`. The change starts at the time specified for the previous event, follows a linear ramp to the new value given in the `value` parameter, and reaches the new value at the time given in the `endTime` parameter.
  48. **/
  49. function linearRampToValueAtTime( value : Float, endTime : Float ) : Void;
  50. /** @throws DOMError */
  51. /**
  52. Schedules a gradual exponential change in the value of the `AudioParam`. The change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the `value` parameter, and reaches the new value at the time given in the `endTime` parameter.
  53. **/
  54. function exponentialRampToValueAtTime( value : Float, endTime : Float ) : Void;
  55. /** @throws DOMError */
  56. /**
  57. Schedules the start of a change to the value of the `AudioParam`. The change starts at the time specified in `startTime` and exponentially moves towards the value given by the `target` parameter. The exponential decay rate is defined by the `timeConstant` parameter, which is a time measured in seconds.
  58. **/
  59. function setTargetAtTime( target : Float, startTime : Float, timeConstant : Float ) : Void;
  60. /** @throws DOMError */
  61. /**
  62. Schedules the values of the `AudioParam` to follow a set of values, defined by the `values` `Float32Array` scaled to fit into the given interval, starting at `startTime`, and having a specific `duration`.
  63. **/
  64. function setValueCurveAtTime( values : js.html.Float32Array, startTime : Float, duration : Float ) : Void;
  65. /** @throws DOMError */
  66. /**
  67. Cancels all scheduled future changes to the `AudioParam`.
  68. **/
  69. function cancelScheduledValues( startTime : Float ) : Void;
  70. }