AudioParam.hx 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. The Web Audio API's `AudioParam` interface represents an audio-related parameter, usually a parameter of an `AudioNode` (such as `GainNode.gain`).
  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. /**
  41. Represents the minimum possible value for the parameter's nominal (effective) range. 
  42. **/
  43. var minValue(default,null) : Float;
  44. /**
  45. Represents the maximum possible value for the parameter's nominal (effective) range. 
  46. **/
  47. var maxValue(default,null) : Float;
  48. /**
  49. Schedules an instant change to the value of the `AudioParam` at a precise time, as measured against `AudioContext.currentTime`. The new value is given by the `value` parameter.
  50. @throws DOMError
  51. **/
  52. function setValueAtTime( value : Float, startTime : Float ) : AudioParam;
  53. /**
  54. 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.
  55. @throws DOMError
  56. **/
  57. function linearRampToValueAtTime( value : Float, endTime : Float ) : AudioParam;
  58. /**
  59. 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.
  60. @throws DOMError
  61. **/
  62. function exponentialRampToValueAtTime( value : Float, endTime : Float ) : AudioParam;
  63. /**
  64. 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.
  65. @throws DOMError
  66. **/
  67. function setTargetAtTime( target : Float, startTime : Float, timeConstant : Float ) : AudioParam;
  68. /**
  69. Schedules the values of the `AudioParam` to follow a set of values, defined by an array of floating-point numbers scaled to fit into the given interval, starting at a given start time and spanning a given duration of time.
  70. @throws DOMError
  71. **/
  72. function setValueCurveAtTime( values : Array<Float>, startTime : Float, duration : Float ) : AudioParam;
  73. /**
  74. Cancels all scheduled future changes to the `AudioParam`.
  75. @throws DOMError
  76. **/
  77. function cancelScheduledValues( startTime : Float ) : AudioParam;
  78. }