AudioParam.hx 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Copyright (C)2005-2019 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. 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.
  33. **/
  34. var value : Float;
  35. /**
  36. Represents the initial volume of the attribute as defined by the specific `AudioNode` creating the `AudioParam`.
  37. **/
  38. var defaultValue(default,null) : Float;
  39. /**
  40. Represents the minimum possible value for the parameter's nominal (effective) range. 
  41. **/
  42. var minValue(default,null) : Float;
  43. /**
  44. Represents the maximum possible value for the parameter's nominal (effective) range. 
  45. **/
  46. var maxValue(default,null) : Float;
  47. /**
  48. 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.
  49. @throws DOMError
  50. **/
  51. function setValueAtTime( value : Float, startTime : Float ) : AudioParam;
  52. /**
  53. 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.
  54. @throws DOMError
  55. **/
  56. function linearRampToValueAtTime( value : Float, endTime : Float ) : AudioParam;
  57. /**
  58. 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.
  59. @throws DOMError
  60. **/
  61. function exponentialRampToValueAtTime( value : Float, endTime : Float ) : AudioParam;
  62. /**
  63. 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.
  64. @throws DOMError
  65. **/
  66. function setTargetAtTime( target : Float, startTime : Float, timeConstant : Float ) : AudioParam;
  67. /**
  68. 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.
  69. @throws DOMError
  70. **/
  71. function setValueCurveAtTime( values : Array<Float>, startTime : Float, duration : Float ) : AudioParam;
  72. /**
  73. Cancels all scheduled future changes to the `AudioParam`.
  74. @throws DOMError
  75. **/
  76. function cancelScheduledValues( startTime : Float ) : AudioParam;
  77. }