| OLD | NEW |
| 1 /** | 1 /** |
| 2 * High-fidelity audio programming in the browser. | 2 * High-fidelity audio programming in the browser. |
| 3 */ | 3 */ |
| 4 library dart.dom.web_audio; | 4 library dart.dom.web_audio; |
| 5 | 5 |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:_internal'; | 8 import 'dart:_internal'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'dart:html_common'; | 10 import 'dart:html_common'; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 final int length; | 94 final int length; |
| 95 | 95 |
| 96 @DomName('AudioBuffer.numberOfChannels') | 96 @DomName('AudioBuffer.numberOfChannels') |
| 97 @DocsEditable() | 97 @DocsEditable() |
| 98 final int numberOfChannels; | 98 final int numberOfChannels; |
| 99 | 99 |
| 100 @DomName('AudioBuffer.sampleRate') | 100 @DomName('AudioBuffer.sampleRate') |
| 101 @DocsEditable() | 101 @DocsEditable() |
| 102 final double sampleRate; | 102 final double sampleRate; |
| 103 | 103 |
| 104 @DomName('AudioBuffer.copyFromChannel') |
| 105 @DocsEditable() |
| 106 @Experimental() // untriaged |
| 107 void copyFromChannel(Float32List destination, int channelNumber, [int startInC
hannel]) native; |
| 108 |
| 109 @DomName('AudioBuffer.copyToChannel') |
| 110 @DocsEditable() |
| 111 @Experimental() // untriaged |
| 112 void copyToChannel(Float32List source, int channelNumber, [int startInChannel]
) native; |
| 113 |
| 104 @DomName('AudioBuffer.getChannelData') | 114 @DomName('AudioBuffer.getChannelData') |
| 105 @DocsEditable() | 115 @DocsEditable() |
| 106 Float32List getChannelData(int channelIndex) native; | 116 Float32List getChannelData(int channelIndex) native; |
| 107 } | 117 } |
| 108 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 118 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 109 // for details. All rights reserved. Use of this source code is governed by a | 119 // for details. All rights reserved. Use of this source code is governed by a |
| 110 // BSD-style license that can be found in the LICENSE file. | 120 // BSD-style license that can be found in the LICENSE file. |
| 111 | 121 |
| 112 // WARNING: Do not edit - generated code. | 122 // WARNING: Do not edit - generated code. |
| 113 | 123 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 */ | 179 */ |
| 170 @DomName('AudioBufferSourceNode.endedEvent') | 180 @DomName('AudioBufferSourceNode.endedEvent') |
| 171 @DocsEditable() | 181 @DocsEditable() |
| 172 @Experimental() // untriaged | 182 @Experimental() // untriaged |
| 173 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider
<Event>('ended'); | 183 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider
<Event>('ended'); |
| 174 | 184 |
| 175 @DomName('AudioBufferSourceNode.buffer') | 185 @DomName('AudioBufferSourceNode.buffer') |
| 176 @DocsEditable() | 186 @DocsEditable() |
| 177 AudioBuffer buffer; | 187 AudioBuffer buffer; |
| 178 | 188 |
| 189 @DomName('AudioBufferSourceNode.detune') |
| 190 @DocsEditable() |
| 191 @Experimental() // untriaged |
| 192 final AudioParam detune; |
| 193 |
| 179 @DomName('AudioBufferSourceNode.loop') | 194 @DomName('AudioBufferSourceNode.loop') |
| 180 @DocsEditable() | 195 @DocsEditable() |
| 181 bool loop; | 196 bool loop; |
| 182 | 197 |
| 183 @DomName('AudioBufferSourceNode.loopEnd') | 198 @DomName('AudioBufferSourceNode.loopEnd') |
| 184 @DocsEditable() | 199 @DocsEditable() |
| 185 num loopEnd; | 200 num loopEnd; |
| 186 | 201 |
| 187 @DomName('AudioBufferSourceNode.loopStart') | 202 @DomName('AudioBufferSourceNode.loopStart') |
| 188 @DocsEditable() | 203 @DocsEditable() |
| (...skipping 18 matching lines...) Expand all Loading... |
| 207 @DomName('AudioContext') | 222 @DomName('AudioContext') |
| 208 @SupportedBrowser(SupportedBrowser.CHROME) | 223 @SupportedBrowser(SupportedBrowser.CHROME) |
| 209 @SupportedBrowser(SupportedBrowser.FIREFOX) | 224 @SupportedBrowser(SupportedBrowser.FIREFOX) |
| 210 @Experimental() | 225 @Experimental() |
| 211 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioCo
ntext-section | 226 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioCo
ntext-section |
| 212 @Native("AudioContext,webkitAudioContext") | 227 @Native("AudioContext,webkitAudioContext") |
| 213 class AudioContext extends EventTarget { | 228 class AudioContext extends EventTarget { |
| 214 // To suppress missing implicit constructor warnings. | 229 // To suppress missing implicit constructor warnings. |
| 215 factory AudioContext._() { throw new UnsupportedError("Not supported"); } | 230 factory AudioContext._() { throw new UnsupportedError("Not supported"); } |
| 216 | 231 |
| 217 /** | |
| 218 * Static factory designed to expose `complete` events to event | |
| 219 * handlers that are not necessarily instances of [AudioContext]. | |
| 220 * | |
| 221 * See [EventStreamProvider] for usage information. | |
| 222 */ | |
| 223 @DomName('AudioContext.completeEvent') | |
| 224 @DocsEditable() | |
| 225 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); | |
| 226 | |
| 227 /// Checks if this type is supported on the current platform. | 232 /// Checks if this type is supported on the current platform. |
| 228 static bool get supported => JS('bool', '!!(window.AudioContext || window.webk
itAudioContext)'); | 233 static bool get supported => JS('bool', '!!(window.AudioContext || window.webk
itAudioContext)'); |
| 229 | 234 |
| 230 @DomName('AudioContext.currentTime') | 235 @DomName('AudioContext.currentTime') |
| 231 @DocsEditable() | 236 @DocsEditable() |
| 232 final double currentTime; | 237 final double currentTime; |
| 233 | 238 |
| 234 @DomName('AudioContext.destination') | 239 @DomName('AudioContext.destination') |
| 235 @DocsEditable() | 240 @DocsEditable() |
| 236 final AudioDestinationNode destination; | 241 final AudioDestinationNode destination; |
| 237 | 242 |
| 238 @DomName('AudioContext.listener') | 243 @DomName('AudioContext.listener') |
| 239 @DocsEditable() | 244 @DocsEditable() |
| 240 final AudioListener listener; | 245 final AudioListener listener; |
| 241 | 246 |
| 242 @DomName('AudioContext.sampleRate') | 247 @DomName('AudioContext.sampleRate') |
| 243 @DocsEditable() | 248 @DocsEditable() |
| 244 final double sampleRate; | 249 final double sampleRate; |
| 245 | 250 |
| 251 @DomName('AudioContext.state') |
| 252 @DocsEditable() |
| 253 @Experimental() // untriaged |
| 254 final String state; |
| 255 |
| 256 @DomName('AudioContext.close') |
| 257 @DocsEditable() |
| 258 @Experimental() // untriaged |
| 259 Future close() native; |
| 260 |
| 246 @DomName('AudioContext.createAnalyser') | 261 @DomName('AudioContext.createAnalyser') |
| 247 @DocsEditable() | 262 @DocsEditable() |
| 248 AnalyserNode createAnalyser() native; | 263 AnalyserNode createAnalyser() native; |
| 249 | 264 |
| 250 @DomName('AudioContext.createBiquadFilter') | 265 @DomName('AudioContext.createBiquadFilter') |
| 251 @DocsEditable() | 266 @DocsEditable() |
| 252 BiquadFilterNode createBiquadFilter() native; | 267 BiquadFilterNode createBiquadFilter() native; |
| 253 | 268 |
| 254 @DomName('AudioContext.createBuffer') | 269 @DomName('AudioContext.createBuffer') |
| 255 @DocsEditable() | 270 @DocsEditable() |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 312 |
| 298 @DomName('AudioContext.createPanner') | 313 @DomName('AudioContext.createPanner') |
| 299 @DocsEditable() | 314 @DocsEditable() |
| 300 PannerNode createPanner() native; | 315 PannerNode createPanner() native; |
| 301 | 316 |
| 302 @DomName('AudioContext.createPeriodicWave') | 317 @DomName('AudioContext.createPeriodicWave') |
| 303 @DocsEditable() | 318 @DocsEditable() |
| 304 @Experimental() // untriaged | 319 @Experimental() // untriaged |
| 305 PeriodicWave createPeriodicWave(Float32List real, Float32List imag) native; | 320 PeriodicWave createPeriodicWave(Float32List real, Float32List imag) native; |
| 306 | 321 |
| 322 @DomName('AudioContext.createStereoPanner') |
| 323 @DocsEditable() |
| 324 @Experimental() // untriaged |
| 325 StereoPannerNode createStereoPanner() native; |
| 326 |
| 307 @DomName('AudioContext.createWaveShaper') | 327 @DomName('AudioContext.createWaveShaper') |
| 308 @DocsEditable() | 328 @DocsEditable() |
| 309 WaveShaperNode createWaveShaper() native; | 329 WaveShaperNode createWaveShaper() native; |
| 310 | 330 |
| 311 @JSName('decodeAudioData') | 331 @JSName('decodeAudioData') |
| 312 @DomName('AudioContext.decodeAudioData') | 332 @DomName('AudioContext.decodeAudioData') |
| 313 @DocsEditable() | 333 @DocsEditable() |
| 314 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac
k, [AudioBufferCallback errorCallback]) native; | 334 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac
k, [AudioBufferCallback errorCallback]) native; |
| 315 | 335 |
| 316 @DomName('AudioContext.startRendering') | 336 @DomName('AudioContext.resume') |
| 317 @DocsEditable() | 337 @DocsEditable() |
| 318 void startRendering() native; | 338 @Experimental() // untriaged |
| 339 Future resume() native; |
| 319 | 340 |
| 320 /// Stream of `complete` events handled by this [AudioContext]. | 341 @DomName('AudioContext.suspend') |
| 321 @DomName('AudioContext.oncomplete') | |
| 322 @DocsEditable() | 342 @DocsEditable() |
| 323 Stream<Event> get onComplete => completeEvent.forTarget(this); | 343 @Experimental() // untriaged |
| 344 Future suspend() native; |
| 324 | 345 |
| 325 factory AudioContext() => JS('AudioContext', | 346 factory AudioContext() => JS('AudioContext', |
| 326 'new (window.AudioContext || window.webkitAudioContext)()'); | 347 'new (window.AudioContext || window.webkitAudioContext)()'); |
| 327 | 348 |
| 328 GainNode createGain() { | 349 GainNode createGain() { |
| 329 if (JS('bool', '#.createGain !== undefined', this)) { | 350 if (JS('bool', '#.createGain !== undefined', this)) { |
| 330 return JS('GainNode', '#.createGain()', this); | 351 return JS('GainNode', '#.createGain()', this); |
| 331 } else { | 352 } else { |
| 332 return JS('GainNode', '#.createGainNode()', this); | 353 return JS('GainNode', '#.createGainNode()', this); |
| 333 } | 354 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 @DocsEditable() | 469 @DocsEditable() |
| 449 final int numberOfInputs; | 470 final int numberOfInputs; |
| 450 | 471 |
| 451 @DomName('AudioNode.numberOfOutputs') | 472 @DomName('AudioNode.numberOfOutputs') |
| 452 @DocsEditable() | 473 @DocsEditable() |
| 453 final int numberOfOutputs; | 474 final int numberOfOutputs; |
| 454 | 475 |
| 455 @JSName('connect') | 476 @JSName('connect') |
| 456 @DomName('AudioNode.connect') | 477 @DomName('AudioNode.connect') |
| 457 @DocsEditable() | 478 @DocsEditable() |
| 458 void _connect(destination, int output, [int input]) native; | 479 void _connect(destination, [int output, int input]) native; |
| 459 | 480 |
| 460 @DomName('AudioNode.disconnect') | 481 @DomName('AudioNode.disconnect') |
| 461 @DocsEditable() | 482 @DocsEditable() |
| 462 void disconnect(int output) native; | 483 void disconnect([destination_OR_output, int output, int input]) native; |
| 463 | 484 |
| 464 @DomName('AudioNode.connect') | 485 @DomName('AudioNode.connect') |
| 465 void connectNode(AudioNode destination, [int output = 0, int input = 0]) => | 486 void connectNode(AudioNode destination, [int output = 0, int input = 0]) => |
| 466 _connect(destination, output, input); | 487 _connect(destination, output, input); |
| 467 | 488 |
| 468 @DomName('AudioNode.connect') | 489 @DomName('AudioNode.connect') |
| 469 void connectParam(AudioParam destination, [int output = 0]) => | 490 void connectParam(AudioParam destination, [int output = 0]) => |
| 470 _connect(destination, output); | 491 _connect(destination, output); |
| 471 } | 492 } |
| 472 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 493 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 class OfflineAudioContext extends AudioContext { | 825 class OfflineAudioContext extends AudioContext { |
| 805 // To suppress missing implicit constructor warnings. | 826 // To suppress missing implicit constructor warnings. |
| 806 factory OfflineAudioContext._() { throw new UnsupportedError("Not supported");
} | 827 factory OfflineAudioContext._() { throw new UnsupportedError("Not supported");
} |
| 807 | 828 |
| 808 @DomName('OfflineAudioContext.OfflineAudioContext') | 829 @DomName('OfflineAudioContext.OfflineAudioContext') |
| 809 @DocsEditable() | 830 @DocsEditable() |
| 810 factory OfflineAudioContext(int numberOfChannels, int numberOfFrames, num samp
leRate) { | 831 factory OfflineAudioContext(int numberOfChannels, int numberOfFrames, num samp
leRate) { |
| 811 return OfflineAudioContext._create_1(numberOfChannels, numberOfFrames, sampl
eRate); | 832 return OfflineAudioContext._create_1(numberOfChannels, numberOfFrames, sampl
eRate); |
| 812 } | 833 } |
| 813 static OfflineAudioContext _create_1(numberOfChannels, numberOfFrames, sampleR
ate) => JS('OfflineAudioContext', 'new OfflineAudioContext(#,#,#)', numberOfChan
nels, numberOfFrames, sampleRate); | 834 static OfflineAudioContext _create_1(numberOfChannels, numberOfFrames, sampleR
ate) => JS('OfflineAudioContext', 'new OfflineAudioContext(#,#,#)', numberOfChan
nels, numberOfFrames, sampleRate); |
| 835 |
| 836 @DomName('OfflineAudioContext.startRendering') |
| 837 @DocsEditable() |
| 838 @Experimental() // untriaged |
| 839 Future startRendering() native; |
| 814 } | 840 } |
| 815 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 841 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 816 // for details. All rights reserved. Use of this source code is governed by a | 842 // for details. All rights reserved. Use of this source code is governed by a |
| 817 // BSD-style license that can be found in the LICENSE file. | 843 // BSD-style license that can be found in the LICENSE file. |
| 818 | 844 |
| 819 | 845 |
| 820 @DocsEditable() | 846 @DocsEditable() |
| 821 @DomName('OscillatorNode') | 847 @DomName('OscillatorNode') |
| 822 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-Osc
illatorNode | 848 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-Osc
illatorNode |
| 823 @Experimental() | 849 @Experimental() |
| (...skipping 18 matching lines...) Expand all Loading... |
| 842 final AudioParam detune; | 868 final AudioParam detune; |
| 843 | 869 |
| 844 @DomName('OscillatorNode.frequency') | 870 @DomName('OscillatorNode.frequency') |
| 845 @DocsEditable() | 871 @DocsEditable() |
| 846 final AudioParam frequency; | 872 final AudioParam frequency; |
| 847 | 873 |
| 848 @DomName('OscillatorNode.type') | 874 @DomName('OscillatorNode.type') |
| 849 @DocsEditable() | 875 @DocsEditable() |
| 850 String type; | 876 String type; |
| 851 | 877 |
| 852 @DomName('OscillatorNode.noteOff') | |
| 853 @DocsEditable() | |
| 854 void noteOff(num when) native; | |
| 855 | |
| 856 @DomName('OscillatorNode.noteOn') | |
| 857 @DocsEditable() | |
| 858 void noteOn(num when) native; | |
| 859 | |
| 860 @DomName('OscillatorNode.setPeriodicWave') | 878 @DomName('OscillatorNode.setPeriodicWave') |
| 861 @DocsEditable() | 879 @DocsEditable() |
| 862 @Experimental() // untriaged | 880 @Experimental() // untriaged |
| 863 void setPeriodicWave(PeriodicWave periodicWave) native; | 881 void setPeriodicWave(PeriodicWave periodicWave) native; |
| 864 | 882 |
| 865 @DomName('OscillatorNode.start') | 883 @DomName('OscillatorNode.start') |
| 866 @DocsEditable() | 884 @DocsEditable() |
| 867 void start([num when]) native; | 885 void start([num when]) native; |
| 868 | 886 |
| 869 @DomName('OscillatorNode.stop') | 887 @DomName('OscillatorNode.stop') |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 @DocsEditable() | 1011 @DocsEditable() |
| 994 @Experimental() // untriaged | 1012 @Experimental() // untriaged |
| 995 Stream<AudioProcessingEvent> get onAudioProcess => audioProcessEvent.forTarget
(this); | 1013 Stream<AudioProcessingEvent> get onAudioProcess => audioProcessEvent.forTarget
(this); |
| 996 } | 1014 } |
| 997 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1015 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 998 // for details. All rights reserved. Use of this source code is governed by a | 1016 // for details. All rights reserved. Use of this source code is governed by a |
| 999 // BSD-style license that can be found in the LICENSE file. | 1017 // BSD-style license that can be found in the LICENSE file. |
| 1000 | 1018 |
| 1001 | 1019 |
| 1002 @DocsEditable() | 1020 @DocsEditable() |
| 1021 @DomName('StereoPannerNode') |
| 1022 @Experimental() // untriaged |
| 1023 @Native("StereoPannerNode") |
| 1024 class StereoPannerNode extends AudioNode { |
| 1025 // To suppress missing implicit constructor warnings. |
| 1026 factory StereoPannerNode._() { throw new UnsupportedError("Not supported"); } |
| 1027 |
| 1028 @DomName('StereoPannerNode.pan') |
| 1029 @DocsEditable() |
| 1030 @Experimental() // untriaged |
| 1031 final AudioParam pan; |
| 1032 } |
| 1033 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1034 // for details. All rights reserved. Use of this source code is governed by a |
| 1035 // BSD-style license that can be found in the LICENSE file. |
| 1036 |
| 1037 |
| 1038 @DocsEditable() |
| 1003 @DomName('WaveShaperNode') | 1039 @DomName('WaveShaperNode') |
| 1004 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-Wav
eShaperNode | 1040 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-Wav
eShaperNode |
| 1005 @Experimental() | 1041 @Experimental() |
| 1006 @Native("WaveShaperNode") | 1042 @Native("WaveShaperNode") |
| 1007 class WaveShaperNode extends AudioNode { | 1043 class WaveShaperNode extends AudioNode { |
| 1008 // To suppress missing implicit constructor warnings. | 1044 // To suppress missing implicit constructor warnings. |
| 1009 factory WaveShaperNode._() { throw new UnsupportedError("Not supported"); } | 1045 factory WaveShaperNode._() { throw new UnsupportedError("Not supported"); } |
| 1010 | 1046 |
| 1011 @DomName('WaveShaperNode.curve') | 1047 @DomName('WaveShaperNode.curve') |
| 1012 @DocsEditable() | 1048 @DocsEditable() |
| 1013 Float32List curve; | 1049 Float32List curve; |
| 1014 | 1050 |
| 1015 @DomName('WaveShaperNode.oversample') | 1051 @DomName('WaveShaperNode.oversample') |
| 1016 @DocsEditable() | 1052 @DocsEditable() |
| 1017 String oversample; | 1053 String oversample; |
| 1018 } | 1054 } |
| OLD | NEW |