AudioContext.hx 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C)2005-2016 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\AudioContext.webidl line 26:0. Do not edit!
  23. package js.html.audio;
  24. @:native("AudioContext")
  25. extern class AudioContext extends js.html.EventTarget
  26. {
  27. var destination(default,null) : AudioDestinationNode;
  28. var sampleRate(default,null) : Float;
  29. var currentTime(default,null) : Float;
  30. var listener(default,null) : AudioListener;
  31. var state(default,null) : js.html.AudioContextState;
  32. var onstatechange : haxe.Constraints.Function;
  33. /** @throws DOMError */
  34. @:overload( function() : Void {} )
  35. function new( audioChannelType : js.html.AudioChannel ) : Void;
  36. /** @throws DOMError */
  37. function suspend() : Promise<Void>;
  38. /** @throws DOMError */
  39. function resume() : Promise<Void>;
  40. /** @throws DOMError */
  41. function close() : Promise<Void>;
  42. /** @throws DOMError */
  43. function createBuffer( numberOfChannels : Int, length : Int, sampleRate : Float ) : AudioBuffer;
  44. /** @throws DOMError */
  45. function decodeAudioData( audioData : js.html.ArrayBuffer, ?successCallback : AudioBuffer -> Void, ?errorCallback : Void -> Void ) : Promise<AudioBuffer>;
  46. /** @throws DOMError */
  47. function createBufferSource() : AudioBufferSourceNode;
  48. /** @throws DOMError */
  49. function createMediaStreamDestination() : MediaStreamAudioDestinationNode;
  50. /** @throws DOMError */
  51. function createScriptProcessor( ?bufferSize : Int = 0, ?numberOfInputChannels : Int = 2, ?numberOfOutputChannels : Int = 2 ) : ScriptProcessorNode;
  52. /** @throws DOMError */
  53. function createStereoPanner() : StereoPannerNode;
  54. /** @throws DOMError */
  55. function createAnalyser() : AnalyserNode;
  56. /** @throws DOMError */
  57. function createMediaElementSource( mediaElement : js.html.MediaElement ) : MediaElementAudioSourceNode;
  58. /** @throws DOMError */
  59. function createMediaStreamSource( mediaStream : js.html.MediaStream ) : MediaStreamAudioSourceNode;
  60. /** @throws DOMError */
  61. function createGain() : GainNode;
  62. /** @throws DOMError */
  63. function createDelay( ?maxDelayTime : Float = 1.0 ) : DelayNode;
  64. /** @throws DOMError */
  65. function createBiquadFilter() : BiquadFilterNode;
  66. /** @throws DOMError */
  67. function createWaveShaper() : WaveShaperNode;
  68. /** @throws DOMError */
  69. function createPanner() : PannerNode;
  70. /** @throws DOMError */
  71. function createConvolver() : ConvolverNode;
  72. /** @throws DOMError */
  73. function createChannelSplitter( ?numberOfOutputs : Int = 6 ) : ChannelSplitterNode;
  74. /** @throws DOMError */
  75. function createChannelMerger( ?numberOfInputs : Int = 6 ) : ChannelMergerNode;
  76. /** @throws DOMError */
  77. function createDynamicsCompressor() : DynamicsCompressorNode;
  78. /** @throws DOMError */
  79. function createOscillator() : OscillatorNode;
  80. /** @throws DOMError */
  81. function createPeriodicWave( real : js.html.Float32Array, imag : js.html.Float32Array ) : PeriodicWave;
  82. }