OLD | NEW |
(Empty) | |
| 1 /** |
| 2 * High-fidelity audio programming in the browser. |
| 3 */ |
| 4 library dart.dom.web_audio; |
| 5 |
| 6 import 'dart:async'; |
| 7 import 'dart:collection'; |
| 8 import 'dart:_internal'; |
| 9 import 'dart:html'; |
| 10 import 'dart:html_common'; |
| 11 import 'dart:_native_typed_data'; |
| 12 import 'dart:typed_data'; |
| 13 import 'dart:_js_helper' show Creates, JSName, Native, Returns, convertDartClosu
reToJS; |
| 14 import 'dart:_foreign_helper' show JS; |
| 15 import 'dart:_interceptors' show Interceptor; |
| 16 // DO NOT EDIT - unless you are editing documentation as per: |
| 17 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation |
| 18 // Auto-generated dart:audio library. |
| 19 |
| 20 |
| 21 |
| 22 |
| 23 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 24 // for details. All rights reserved. Use of this source code is governed by a |
| 25 // BSD-style license that can be found in the LICENSE file. |
| 26 |
| 27 |
| 28 @DocsEditable() |
| 29 @DomName('AnalyserNode') |
| 30 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Analyse
rNode |
| 31 @Experimental() |
| 32 @Native("AnalyserNode,RealtimeAnalyserNode") |
| 33 class AnalyserNode extends AudioNode { |
| 34 // To suppress missing implicit constructor warnings. |
| 35 factory AnalyserNode._() { throw new UnsupportedError("Not supported"); } |
| 36 |
| 37 @DomName('AnalyserNode.fftSize') |
| 38 @DocsEditable() |
| 39 int fftSize; |
| 40 |
| 41 @DomName('AnalyserNode.frequencyBinCount') |
| 42 @DocsEditable() |
| 43 final int frequencyBinCount; |
| 44 |
| 45 @DomName('AnalyserNode.maxDecibels') |
| 46 @DocsEditable() |
| 47 num maxDecibels; |
| 48 |
| 49 @DomName('AnalyserNode.minDecibels') |
| 50 @DocsEditable() |
| 51 num minDecibels; |
| 52 |
| 53 @DomName('AnalyserNode.smoothingTimeConstant') |
| 54 @DocsEditable() |
| 55 num smoothingTimeConstant; |
| 56 |
| 57 @DomName('AnalyserNode.getByteFrequencyData') |
| 58 @DocsEditable() |
| 59 void getByteFrequencyData(Uint8List array) native; |
| 60 |
| 61 @DomName('AnalyserNode.getByteTimeDomainData') |
| 62 @DocsEditable() |
| 63 void getByteTimeDomainData(Uint8List array) native; |
| 64 |
| 65 @DomName('AnalyserNode.getFloatFrequencyData') |
| 66 @DocsEditable() |
| 67 void getFloatFrequencyData(Float32List array) native; |
| 68 |
| 69 @DomName('AnalyserNode.getFloatTimeDomainData') |
| 70 @DocsEditable() |
| 71 @Experimental() // untriaged |
| 72 void getFloatTimeDomainData(Float32List array) native; |
| 73 } |
| 74 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 75 // for details. All rights reserved. Use of this source code is governed by a |
| 76 // BSD-style license that can be found in the LICENSE file. |
| 77 |
| 78 |
| 79 @DocsEditable() |
| 80 @DomName('AudioBuffer') |
| 81 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBu
ffer-section |
| 82 @Experimental() |
| 83 @Native("AudioBuffer") |
| 84 class AudioBuffer extends Interceptor { |
| 85 // To suppress missing implicit constructor warnings. |
| 86 factory AudioBuffer._() { throw new UnsupportedError("Not supported"); } |
| 87 |
| 88 @DomName('AudioBuffer.duration') |
| 89 @DocsEditable() |
| 90 final double duration; |
| 91 |
| 92 @DomName('AudioBuffer.length') |
| 93 @DocsEditable() |
| 94 final int length; |
| 95 |
| 96 @DomName('AudioBuffer.numberOfChannels') |
| 97 @DocsEditable() |
| 98 final int numberOfChannels; |
| 99 |
| 100 @DomName('AudioBuffer.sampleRate') |
| 101 @DocsEditable() |
| 102 final double sampleRate; |
| 103 |
| 104 @DomName('AudioBuffer.getChannelData') |
| 105 @DocsEditable() |
| 106 Float32List getChannelData(int channelIndex) native; |
| 107 } |
| 108 // 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 |
| 110 // BSD-style license that can be found in the LICENSE file. |
| 111 |
| 112 // WARNING: Do not edit - generated code. |
| 113 |
| 114 |
| 115 @DomName('AudioBufferCallback') |
| 116 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBu
ffer-section |
| 117 @Experimental() |
| 118 typedef void AudioBufferCallback(AudioBuffer audioBuffer); |
| 119 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 120 // for details. All rights reserved. Use of this source code is governed by a |
| 121 // BSD-style license that can be found in the LICENSE file. |
| 122 |
| 123 |
| 124 @DomName('AudioBufferSourceNode') |
| 125 @SupportedBrowser(SupportedBrowser.CHROME) |
| 126 @SupportedBrowser(SupportedBrowser.FIREFOX) |
| 127 @Experimental() |
| 128 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBu
fferSourceNode-section |
| 129 @Native("AudioBufferSourceNode") |
| 130 class AudioBufferSourceNode extends AudioSourceNode { |
| 131 |
| 132 // TODO(efortuna): Remove these methods when Chrome stable also uses start |
| 133 // instead of noteOn. |
| 134 void start(num when, [num grainOffset, num grainDuration]) { |
| 135 if (JS('bool', '!!#.start', this)) { |
| 136 if (grainDuration != null) { |
| 137 JS('void', '#.start(#, #, #)', this, when, grainOffset, grainDuration); |
| 138 } else if (grainOffset != null) { |
| 139 JS('void', '#.start(#, #)', this, when, grainOffset); |
| 140 } else { |
| 141 JS('void', '#.start(#)', this, when); |
| 142 } |
| 143 } else { |
| 144 if (grainDuration != null) { |
| 145 JS('void', '#.noteOn(#, #, #)', this, when, grainOffset, grainDuration); |
| 146 } else if (grainOffset != null) { |
| 147 JS('void', '#.noteOn(#, #)', this, when, grainOffset); |
| 148 } else { |
| 149 JS('void', '#.noteOn(#)', this, when); |
| 150 } |
| 151 } |
| 152 } |
| 153 |
| 154 void stop(num when) { |
| 155 if (JS('bool', '!!#.stop', this)) { |
| 156 JS('void', '#.stop(#)', this, when); |
| 157 } else { |
| 158 JS('void', '#.noteOff(#)', this, when); |
| 159 } |
| 160 } |
| 161 // To suppress missing implicit constructor warnings. |
| 162 factory AudioBufferSourceNode._() { throw new UnsupportedError("Not supported"
); } |
| 163 |
| 164 /** |
| 165 * Static factory designed to expose `ended` events to event |
| 166 * handlers that are not necessarily instances of [AudioBufferSourceNode]. |
| 167 * |
| 168 * See [EventStreamProvider] for usage information. |
| 169 */ |
| 170 @DomName('AudioBufferSourceNode.endedEvent') |
| 171 @DocsEditable() |
| 172 @Experimental() // untriaged |
| 173 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider
<Event>('ended'); |
| 174 |
| 175 @DomName('AudioBufferSourceNode.buffer') |
| 176 @DocsEditable() |
| 177 AudioBuffer buffer; |
| 178 |
| 179 @DomName('AudioBufferSourceNode.loop') |
| 180 @DocsEditable() |
| 181 bool loop; |
| 182 |
| 183 @DomName('AudioBufferSourceNode.loopEnd') |
| 184 @DocsEditable() |
| 185 num loopEnd; |
| 186 |
| 187 @DomName('AudioBufferSourceNode.loopStart') |
| 188 @DocsEditable() |
| 189 num loopStart; |
| 190 |
| 191 @DomName('AudioBufferSourceNode.playbackRate') |
| 192 @DocsEditable() |
| 193 final AudioParam playbackRate; |
| 194 |
| 195 /// Stream of `ended` events handled by this [AudioBufferSourceNode]. |
| 196 @DomName('AudioBufferSourceNode.onended') |
| 197 @DocsEditable() |
| 198 @Experimental() // untriaged |
| 199 Stream<Event> get onEnded => endedEvent.forTarget(this); |
| 200 |
| 201 } |
| 202 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 203 // for details. All rights reserved. Use of this source code is governed by a |
| 204 // BSD-style license that can be found in the LICENSE file. |
| 205 |
| 206 |
| 207 @DomName('AudioContext') |
| 208 @SupportedBrowser(SupportedBrowser.CHROME) |
| 209 @SupportedBrowser(SupportedBrowser.FIREFOX) |
| 210 @Experimental() |
| 211 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioCo
ntext-section |
| 212 @Native("AudioContext,webkitAudioContext") |
| 213 class AudioContext extends EventTarget { |
| 214 // To suppress missing implicit constructor warnings. |
| 215 factory AudioContext._() { throw new UnsupportedError("Not supported"); } |
| 216 |
| 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. |
| 228 static bool get supported => JS('bool', '!!(window.AudioContext || window.webk
itAudioContext)'); |
| 229 |
| 230 @DomName('AudioContext.currentTime') |
| 231 @DocsEditable() |
| 232 final double currentTime; |
| 233 |
| 234 @DomName('AudioContext.destination') |
| 235 @DocsEditable() |
| 236 final AudioDestinationNode destination; |
| 237 |
| 238 @DomName('AudioContext.listener') |
| 239 @DocsEditable() |
| 240 final AudioListener listener; |
| 241 |
| 242 @DomName('AudioContext.sampleRate') |
| 243 @DocsEditable() |
| 244 final double sampleRate; |
| 245 |
| 246 @DomName('AudioContext.createAnalyser') |
| 247 @DocsEditable() |
| 248 AnalyserNode createAnalyser() native; |
| 249 |
| 250 @DomName('AudioContext.createBiquadFilter') |
| 251 @DocsEditable() |
| 252 BiquadFilterNode createBiquadFilter() native; |
| 253 |
| 254 @DomName('AudioContext.createBuffer') |
| 255 @DocsEditable() |
| 256 AudioBuffer createBuffer(int numberOfChannels, int numberOfFrames, num sampleR
ate) native; |
| 257 |
| 258 @DomName('AudioContext.createBufferSource') |
| 259 @DocsEditable() |
| 260 AudioBufferSourceNode createBufferSource() native; |
| 261 |
| 262 @DomName('AudioContext.createChannelMerger') |
| 263 @DocsEditable() |
| 264 ChannelMergerNode createChannelMerger([int numberOfInputs]) native; |
| 265 |
| 266 @DomName('AudioContext.createChannelSplitter') |
| 267 @DocsEditable() |
| 268 ChannelSplitterNode createChannelSplitter([int numberOfOutputs]) native; |
| 269 |
| 270 @DomName('AudioContext.createConvolver') |
| 271 @DocsEditable() |
| 272 ConvolverNode createConvolver() native; |
| 273 |
| 274 @DomName('AudioContext.createDelay') |
| 275 @DocsEditable() |
| 276 DelayNode createDelay([num maxDelayTime]) native; |
| 277 |
| 278 @DomName('AudioContext.createDynamicsCompressor') |
| 279 @DocsEditable() |
| 280 DynamicsCompressorNode createDynamicsCompressor() native; |
| 281 |
| 282 @DomName('AudioContext.createMediaElementSource') |
| 283 @DocsEditable() |
| 284 MediaElementAudioSourceNode createMediaElementSource(MediaElement mediaElement
) native; |
| 285 |
| 286 @DomName('AudioContext.createMediaStreamDestination') |
| 287 @DocsEditable() |
| 288 MediaStreamAudioDestinationNode createMediaStreamDestination() native; |
| 289 |
| 290 @DomName('AudioContext.createMediaStreamSource') |
| 291 @DocsEditable() |
| 292 MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream) na
tive; |
| 293 |
| 294 @DomName('AudioContext.createOscillator') |
| 295 @DocsEditable() |
| 296 OscillatorNode createOscillator() native; |
| 297 |
| 298 @DomName('AudioContext.createPanner') |
| 299 @DocsEditable() |
| 300 PannerNode createPanner() native; |
| 301 |
| 302 @DomName('AudioContext.createPeriodicWave') |
| 303 @DocsEditable() |
| 304 @Experimental() // untriaged |
| 305 PeriodicWave createPeriodicWave(Float32List real, Float32List imag) native; |
| 306 |
| 307 @DomName('AudioContext.createWaveShaper') |
| 308 @DocsEditable() |
| 309 WaveShaperNode createWaveShaper() native; |
| 310 |
| 311 @JSName('decodeAudioData') |
| 312 @DomName('AudioContext.decodeAudioData') |
| 313 @DocsEditable() |
| 314 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac
k, [AudioBufferCallback errorCallback]) native; |
| 315 |
| 316 @DomName('AudioContext.startRendering') |
| 317 @DocsEditable() |
| 318 void startRendering() native; |
| 319 |
| 320 /// Stream of `complete` events handled by this [AudioContext]. |
| 321 @DomName('AudioContext.oncomplete') |
| 322 @DocsEditable() |
| 323 Stream<Event> get onComplete => completeEvent.forTarget(this); |
| 324 |
| 325 factory AudioContext() => JS('AudioContext', |
| 326 'new (window.AudioContext || window.webkitAudioContext)()'); |
| 327 |
| 328 GainNode createGain() { |
| 329 if (JS('bool', '#.createGain !== undefined', this)) { |
| 330 return JS('GainNode', '#.createGain()', this); |
| 331 } else { |
| 332 return JS('GainNode', '#.createGainNode()', this); |
| 333 } |
| 334 } |
| 335 |
| 336 ScriptProcessorNode createScriptProcessor(int bufferSize, |
| 337 [int numberOfInputChannels, int numberOfOutputChannels]) { |
| 338 var function = JS('=Object', '#.createScriptProcessor || ' |
| 339 '#.createJavaScriptNode', this, this); |
| 340 if (numberOfOutputChannels != null) { |
| 341 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, |
| 342 bufferSize, numberOfInputChannels, numberOfOutputChannels); |
| 343 } else if (numberOfInputChannels != null) { |
| 344 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this, |
| 345 bufferSize, numberOfInputChannels); |
| 346 } else { |
| 347 return JS('ScriptProcessorNode', '#.call(#, #)', function, this, |
| 348 bufferSize); |
| 349 } |
| 350 } |
| 351 @DomName('AudioContext.decodeAudioData') |
| 352 Future<AudioBuffer> decodeAudioData(ByteBuffer audioData) { |
| 353 var completer = new Completer<AudioBuffer>(); |
| 354 _decodeAudioData(audioData, |
| 355 (value) { completer.complete(value); }, |
| 356 (error) { |
| 357 if (error == null) { |
| 358 completer.completeError(''); |
| 359 } else { |
| 360 completer.completeError(error); |
| 361 } |
| 362 }); |
| 363 return completer.future; |
| 364 } |
| 365 } |
| 366 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 367 // for details. All rights reserved. Use of this source code is governed by a |
| 368 // BSD-style license that can be found in the LICENSE file. |
| 369 |
| 370 |
| 371 @DocsEditable() |
| 372 @DomName('AudioDestinationNode') |
| 373 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioDe
stinationNode-section |
| 374 @Experimental() |
| 375 @Native("AudioDestinationNode") |
| 376 class AudioDestinationNode extends AudioNode { |
| 377 // To suppress missing implicit constructor warnings. |
| 378 factory AudioDestinationNode._() { throw new UnsupportedError("Not supported")
; } |
| 379 |
| 380 @DomName('AudioDestinationNode.maxChannelCount') |
| 381 @DocsEditable() |
| 382 final int maxChannelCount; |
| 383 } |
| 384 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 385 // for details. All rights reserved. Use of this source code is governed by a |
| 386 // BSD-style license that can be found in the LICENSE file. |
| 387 |
| 388 |
| 389 @DocsEditable() |
| 390 @DomName('AudioListener') |
| 391 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioLi
stener-section |
| 392 @Experimental() |
| 393 @Native("AudioListener") |
| 394 class AudioListener extends Interceptor { |
| 395 // To suppress missing implicit constructor warnings. |
| 396 factory AudioListener._() { throw new UnsupportedError("Not supported"); } |
| 397 |
| 398 @DomName('AudioListener.dopplerFactor') |
| 399 @DocsEditable() |
| 400 num dopplerFactor; |
| 401 |
| 402 @DomName('AudioListener.speedOfSound') |
| 403 @DocsEditable() |
| 404 num speedOfSound; |
| 405 |
| 406 @DomName('AudioListener.setOrientation') |
| 407 @DocsEditable() |
| 408 void setOrientation(num x, num y, num z, num xUp, num yUp, num zUp) native; |
| 409 |
| 410 @DomName('AudioListener.setPosition') |
| 411 @DocsEditable() |
| 412 void setPosition(num x, num y, num z) native; |
| 413 |
| 414 @DomName('AudioListener.setVelocity') |
| 415 @DocsEditable() |
| 416 void setVelocity(num x, num y, num z) native; |
| 417 } |
| 418 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 419 // for details. All rights reserved. Use of this source code is governed by a |
| 420 // BSD-style license that can be found in the LICENSE file. |
| 421 |
| 422 |
| 423 @DomName('AudioNode') |
| 424 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioNo
de-section |
| 425 @Experimental() |
| 426 @Native("AudioNode") |
| 427 class AudioNode extends EventTarget { |
| 428 // To suppress missing implicit constructor warnings. |
| 429 factory AudioNode._() { throw new UnsupportedError("Not supported"); } |
| 430 |
| 431 @DomName('AudioNode.channelCount') |
| 432 @DocsEditable() |
| 433 int channelCount; |
| 434 |
| 435 @DomName('AudioNode.channelCountMode') |
| 436 @DocsEditable() |
| 437 String channelCountMode; |
| 438 |
| 439 @DomName('AudioNode.channelInterpretation') |
| 440 @DocsEditable() |
| 441 String channelInterpretation; |
| 442 |
| 443 @DomName('AudioNode.context') |
| 444 @DocsEditable() |
| 445 final AudioContext context; |
| 446 |
| 447 @DomName('AudioNode.numberOfInputs') |
| 448 @DocsEditable() |
| 449 final int numberOfInputs; |
| 450 |
| 451 @DomName('AudioNode.numberOfOutputs') |
| 452 @DocsEditable() |
| 453 final int numberOfOutputs; |
| 454 |
| 455 @JSName('connect') |
| 456 @DomName('AudioNode.connect') |
| 457 @DocsEditable() |
| 458 void _connect(destination, int output, [int input]) native; |
| 459 |
| 460 @DomName('AudioNode.disconnect') |
| 461 @DocsEditable() |
| 462 void disconnect(int output) native; |
| 463 |
| 464 @DomName('AudioNode.connect') |
| 465 void connectNode(AudioNode destination, [int output = 0, int input = 0]) => |
| 466 _connect(destination, output, input); |
| 467 |
| 468 @DomName('AudioNode.connect') |
| 469 void connectParam(AudioParam destination, [int output = 0]) => |
| 470 _connect(destination, output); |
| 471 } |
| 472 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 473 // for details. All rights reserved. Use of this source code is governed by a |
| 474 // BSD-style license that can be found in the LICENSE file. |
| 475 |
| 476 |
| 477 @DocsEditable() |
| 478 @DomName('AudioParam') |
| 479 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioPa
ram |
| 480 @Experimental() |
| 481 @Native("AudioParam") |
| 482 class AudioParam extends Interceptor { |
| 483 // To suppress missing implicit constructor warnings. |
| 484 factory AudioParam._() { throw new UnsupportedError("Not supported"); } |
| 485 |
| 486 @DomName('AudioParam.defaultValue') |
| 487 @DocsEditable() |
| 488 final double defaultValue; |
| 489 |
| 490 @DomName('AudioParam.value') |
| 491 @DocsEditable() |
| 492 num value; |
| 493 |
| 494 @DomName('AudioParam.cancelScheduledValues') |
| 495 @DocsEditable() |
| 496 void cancelScheduledValues(num startTime) native; |
| 497 |
| 498 @DomName('AudioParam.exponentialRampToValueAtTime') |
| 499 @DocsEditable() |
| 500 void exponentialRampToValueAtTime(num value, num time) native; |
| 501 |
| 502 @DomName('AudioParam.linearRampToValueAtTime') |
| 503 @DocsEditable() |
| 504 void linearRampToValueAtTime(num value, num time) native; |
| 505 |
| 506 @DomName('AudioParam.setTargetAtTime') |
| 507 @DocsEditable() |
| 508 void setTargetAtTime(num target, num time, num timeConstant) native; |
| 509 |
| 510 @DomName('AudioParam.setValueAtTime') |
| 511 @DocsEditable() |
| 512 void setValueAtTime(num value, num time) native; |
| 513 |
| 514 @DomName('AudioParam.setValueCurveAtTime') |
| 515 @DocsEditable() |
| 516 void setValueCurveAtTime(Float32List values, num time, num duration) native; |
| 517 } |
| 518 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 519 // for details. All rights reserved. Use of this source code is governed by a |
| 520 // BSD-style license that can be found in the LICENSE file. |
| 521 |
| 522 |
| 523 @DocsEditable() |
| 524 @DomName('AudioProcessingEvent') |
| 525 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioPr
ocessingEvent-section |
| 526 @Experimental() |
| 527 @Native("AudioProcessingEvent") |
| 528 class AudioProcessingEvent extends Event { |
| 529 // To suppress missing implicit constructor warnings. |
| 530 factory AudioProcessingEvent._() { throw new UnsupportedError("Not supported")
; } |
| 531 |
| 532 @DomName('AudioProcessingEvent.inputBuffer') |
| 533 @DocsEditable() |
| 534 final AudioBuffer inputBuffer; |
| 535 |
| 536 @DomName('AudioProcessingEvent.outputBuffer') |
| 537 @DocsEditable() |
| 538 final AudioBuffer outputBuffer; |
| 539 |
| 540 @DomName('AudioProcessingEvent.playbackTime') |
| 541 @DocsEditable() |
| 542 @Experimental() // untriaged |
| 543 final double playbackTime; |
| 544 } |
| 545 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 546 // for details. All rights reserved. Use of this source code is governed by a |
| 547 // BSD-style license that can be found in the LICENSE file. |
| 548 |
| 549 |
| 550 @DocsEditable() |
| 551 @DomName('AudioSourceNode') |
| 552 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html |
| 553 @Experimental() |
| 554 @Native("AudioSourceNode") |
| 555 class AudioSourceNode extends AudioNode { |
| 556 // To suppress missing implicit constructor warnings. |
| 557 factory AudioSourceNode._() { throw new UnsupportedError("Not supported"); } |
| 558 } |
| 559 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 560 // for details. All rights reserved. Use of this source code is governed by a |
| 561 // BSD-style license that can be found in the LICENSE file. |
| 562 |
| 563 |
| 564 @DocsEditable() |
| 565 @DomName('BiquadFilterNode') |
| 566 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#BiquadF
ilterNode-section |
| 567 @Experimental() |
| 568 @Native("BiquadFilterNode") |
| 569 class BiquadFilterNode extends AudioNode { |
| 570 // To suppress missing implicit constructor warnings. |
| 571 factory BiquadFilterNode._() { throw new UnsupportedError("Not supported"); } |
| 572 |
| 573 @DomName('BiquadFilterNode.Q') |
| 574 @DocsEditable() |
| 575 final AudioParam Q; |
| 576 |
| 577 @DomName('BiquadFilterNode.detune') |
| 578 @DocsEditable() |
| 579 final AudioParam detune; |
| 580 |
| 581 @DomName('BiquadFilterNode.frequency') |
| 582 @DocsEditable() |
| 583 final AudioParam frequency; |
| 584 |
| 585 @DomName('BiquadFilterNode.gain') |
| 586 @DocsEditable() |
| 587 final AudioParam gain; |
| 588 |
| 589 @DomName('BiquadFilterNode.type') |
| 590 @DocsEditable() |
| 591 String type; |
| 592 |
| 593 @DomName('BiquadFilterNode.getFrequencyResponse') |
| 594 @DocsEditable() |
| 595 void getFrequencyResponse(Float32List frequencyHz, Float32List magResponse, Fl
oat32List phaseResponse) native; |
| 596 } |
| 597 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 598 // for details. All rights reserved. Use of this source code is governed by a |
| 599 // BSD-style license that can be found in the LICENSE file. |
| 600 |
| 601 |
| 602 @DocsEditable() |
| 603 @DomName('ChannelMergerNode') |
| 604 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Channel
MergerNode-section |
| 605 @Experimental() |
| 606 @Native("ChannelMergerNode,AudioChannelMerger") |
| 607 class ChannelMergerNode extends AudioNode { |
| 608 // To suppress missing implicit constructor warnings. |
| 609 factory ChannelMergerNode._() { throw new UnsupportedError("Not supported"); } |
| 610 } |
| 611 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 612 // for details. All rights reserved. Use of this source code is governed by a |
| 613 // BSD-style license that can be found in the LICENSE file. |
| 614 |
| 615 |
| 616 @DocsEditable() |
| 617 @DomName('ChannelSplitterNode') |
| 618 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Channel
SplitterNode-section |
| 619 @Experimental() |
| 620 @Native("ChannelSplitterNode,AudioChannelSplitter") |
| 621 class ChannelSplitterNode extends AudioNode { |
| 622 // To suppress missing implicit constructor warnings. |
| 623 factory ChannelSplitterNode._() { throw new UnsupportedError("Not supported");
} |
| 624 } |
| 625 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 626 // for details. All rights reserved. Use of this source code is governed by a |
| 627 // BSD-style license that can be found in the LICENSE file. |
| 628 |
| 629 |
| 630 @DocsEditable() |
| 631 @DomName('ConvolverNode') |
| 632 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Convolv
erNode |
| 633 @Experimental() |
| 634 @Native("ConvolverNode") |
| 635 class ConvolverNode extends AudioNode { |
| 636 // To suppress missing implicit constructor warnings. |
| 637 factory ConvolverNode._() { throw new UnsupportedError("Not supported"); } |
| 638 |
| 639 @DomName('ConvolverNode.buffer') |
| 640 @DocsEditable() |
| 641 AudioBuffer buffer; |
| 642 |
| 643 @DomName('ConvolverNode.normalize') |
| 644 @DocsEditable() |
| 645 bool normalize; |
| 646 } |
| 647 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 648 // for details. All rights reserved. Use of this source code is governed by a |
| 649 // BSD-style license that can be found in the LICENSE file. |
| 650 |
| 651 |
| 652 @DocsEditable() |
| 653 @DomName('DelayNode') |
| 654 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#DelayNo
de |
| 655 @Experimental() |
| 656 @Native("DelayNode") |
| 657 class DelayNode extends AudioNode { |
| 658 // To suppress missing implicit constructor warnings. |
| 659 factory DelayNode._() { throw new UnsupportedError("Not supported"); } |
| 660 |
| 661 @DomName('DelayNode.delayTime') |
| 662 @DocsEditable() |
| 663 final AudioParam delayTime; |
| 664 } |
| 665 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 666 // for details. All rights reserved. Use of this source code is governed by a |
| 667 // BSD-style license that can be found in the LICENSE file. |
| 668 |
| 669 |
| 670 @DocsEditable() |
| 671 @DomName('DynamicsCompressorNode') |
| 672 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Dynamic
sCompressorNode |
| 673 @Experimental() |
| 674 @Native("DynamicsCompressorNode") |
| 675 class DynamicsCompressorNode extends AudioNode { |
| 676 // To suppress missing implicit constructor warnings. |
| 677 factory DynamicsCompressorNode._() { throw new UnsupportedError("Not supported
"); } |
| 678 |
| 679 @DomName('DynamicsCompressorNode.attack') |
| 680 @DocsEditable() |
| 681 final AudioParam attack; |
| 682 |
| 683 @DomName('DynamicsCompressorNode.knee') |
| 684 @DocsEditable() |
| 685 final AudioParam knee; |
| 686 |
| 687 @DomName('DynamicsCompressorNode.ratio') |
| 688 @DocsEditable() |
| 689 final AudioParam ratio; |
| 690 |
| 691 @DomName('DynamicsCompressorNode.reduction') |
| 692 @DocsEditable() |
| 693 final AudioParam reduction; |
| 694 |
| 695 @DomName('DynamicsCompressorNode.release') |
| 696 @DocsEditable() |
| 697 final AudioParam release; |
| 698 |
| 699 @DomName('DynamicsCompressorNode.threshold') |
| 700 @DocsEditable() |
| 701 final AudioParam threshold; |
| 702 } |
| 703 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 704 // for details. All rights reserved. Use of this source code is governed by a |
| 705 // BSD-style license that can be found in the LICENSE file. |
| 706 |
| 707 |
| 708 @DocsEditable() |
| 709 @DomName('GainNode') |
| 710 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#GainNod
e |
| 711 @Experimental() |
| 712 @Native("GainNode,AudioGainNode") |
| 713 class GainNode extends AudioNode { |
| 714 // To suppress missing implicit constructor warnings. |
| 715 factory GainNode._() { throw new UnsupportedError("Not supported"); } |
| 716 |
| 717 @DomName('GainNode.gain') |
| 718 @DocsEditable() |
| 719 final AudioParam gain; |
| 720 } |
| 721 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 722 // for details. All rights reserved. Use of this source code is governed by a |
| 723 // BSD-style license that can be found in the LICENSE file. |
| 724 |
| 725 |
| 726 @DocsEditable() |
| 727 @DomName('MediaElementAudioSourceNode') |
| 728 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaEl
ementAudioSourceNode |
| 729 @Experimental() |
| 730 @Native("MediaElementAudioSourceNode") |
| 731 class MediaElementAudioSourceNode extends AudioSourceNode { |
| 732 // To suppress missing implicit constructor warnings. |
| 733 factory MediaElementAudioSourceNode._() { throw new UnsupportedError("Not supp
orted"); } |
| 734 |
| 735 @DomName('MediaElementAudioSourceNode.mediaElement') |
| 736 @DocsEditable() |
| 737 @Experimental() // non-standard |
| 738 final MediaElement mediaElement; |
| 739 } |
| 740 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 741 // for details. All rights reserved. Use of this source code is governed by a |
| 742 // BSD-style license that can be found in the LICENSE file. |
| 743 |
| 744 |
| 745 @DocsEditable() |
| 746 @DomName('MediaStreamAudioDestinationNode') |
| 747 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaSt
reamAudioDestinationNode |
| 748 @Experimental() |
| 749 @Native("MediaStreamAudioDestinationNode") |
| 750 class MediaStreamAudioDestinationNode extends AudioNode { |
| 751 // To suppress missing implicit constructor warnings. |
| 752 factory MediaStreamAudioDestinationNode._() { throw new UnsupportedError("Not
supported"); } |
| 753 |
| 754 @DomName('MediaStreamAudioDestinationNode.stream') |
| 755 @DocsEditable() |
| 756 final MediaStream stream; |
| 757 } |
| 758 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 759 // for details. All rights reserved. Use of this source code is governed by a |
| 760 // BSD-style license that can be found in the LICENSE file. |
| 761 |
| 762 |
| 763 @DocsEditable() |
| 764 @DomName('MediaStreamAudioSourceNode') |
| 765 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#MediaSt
reamAudioSourceNode |
| 766 @Experimental() |
| 767 @Native("MediaStreamAudioSourceNode") |
| 768 class MediaStreamAudioSourceNode extends AudioSourceNode { |
| 769 // To suppress missing implicit constructor warnings. |
| 770 factory MediaStreamAudioSourceNode._() { throw new UnsupportedError("Not suppo
rted"); } |
| 771 |
| 772 @DomName('MediaStreamAudioSourceNode.mediaStream') |
| 773 @DocsEditable() |
| 774 final MediaStream mediaStream; |
| 775 } |
| 776 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 777 // for details. All rights reserved. Use of this source code is governed by a |
| 778 // BSD-style license that can be found in the LICENSE file. |
| 779 |
| 780 |
| 781 @DocsEditable() |
| 782 @DomName('OfflineAudioCompletionEvent') |
| 783 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Offline
AudioCompletionEvent-section |
| 784 @Experimental() |
| 785 @Native("OfflineAudioCompletionEvent") |
| 786 class OfflineAudioCompletionEvent extends Event { |
| 787 // To suppress missing implicit constructor warnings. |
| 788 factory OfflineAudioCompletionEvent._() { throw new UnsupportedError("Not supp
orted"); } |
| 789 |
| 790 @DomName('OfflineAudioCompletionEvent.renderedBuffer') |
| 791 @DocsEditable() |
| 792 final AudioBuffer renderedBuffer; |
| 793 } |
| 794 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 795 // for details. All rights reserved. Use of this source code is governed by a |
| 796 // BSD-style license that can be found in the LICENSE file. |
| 797 |
| 798 |
| 799 @DocsEditable() |
| 800 @DomName('OfflineAudioContext') |
| 801 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#Offline
AudioContext-section |
| 802 @Experimental() |
| 803 @Native("OfflineAudioContext") |
| 804 class OfflineAudioContext extends AudioContext { |
| 805 // To suppress missing implicit constructor warnings. |
| 806 factory OfflineAudioContext._() { throw new UnsupportedError("Not supported");
} |
| 807 |
| 808 @DomName('OfflineAudioContext.OfflineAudioContext') |
| 809 @DocsEditable() |
| 810 factory OfflineAudioContext(int numberOfChannels, int numberOfFrames, num samp
leRate) { |
| 811 return OfflineAudioContext._create_1(numberOfChannels, numberOfFrames, sampl
eRate); |
| 812 } |
| 813 static OfflineAudioContext _create_1(numberOfChannels, numberOfFrames, sampleR
ate) => JS('OfflineAudioContext', 'new OfflineAudioContext(#,#,#)', numberOfChan
nels, numberOfFrames, sampleRate); |
| 814 } |
| 815 // 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 |
| 817 // BSD-style license that can be found in the LICENSE file. |
| 818 |
| 819 |
| 820 @DocsEditable() |
| 821 @DomName('OscillatorNode') |
| 822 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-Osc
illatorNode |
| 823 @Experimental() |
| 824 @Native("OscillatorNode,Oscillator") |
| 825 class OscillatorNode extends AudioSourceNode { |
| 826 // To suppress missing implicit constructor warnings. |
| 827 factory OscillatorNode._() { throw new UnsupportedError("Not supported"); } |
| 828 |
| 829 /** |
| 830 * Static factory designed to expose `ended` events to event |
| 831 * handlers that are not necessarily instances of [OscillatorNode]. |
| 832 * |
| 833 * See [EventStreamProvider] for usage information. |
| 834 */ |
| 835 @DomName('OscillatorNode.endedEvent') |
| 836 @DocsEditable() |
| 837 @Experimental() // untriaged |
| 838 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider
<Event>('ended'); |
| 839 |
| 840 @DomName('OscillatorNode.detune') |
| 841 @DocsEditable() |
| 842 final AudioParam detune; |
| 843 |
| 844 @DomName('OscillatorNode.frequency') |
| 845 @DocsEditable() |
| 846 final AudioParam frequency; |
| 847 |
| 848 @DomName('OscillatorNode.type') |
| 849 @DocsEditable() |
| 850 String type; |
| 851 |
| 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') |
| 861 @DocsEditable() |
| 862 @Experimental() // untriaged |
| 863 void setPeriodicWave(PeriodicWave periodicWave) native; |
| 864 |
| 865 @DomName('OscillatorNode.start') |
| 866 @DocsEditable() |
| 867 void start([num when]) native; |
| 868 |
| 869 @DomName('OscillatorNode.stop') |
| 870 @DocsEditable() |
| 871 void stop([num when]) native; |
| 872 |
| 873 /// Stream of `ended` events handled by this [OscillatorNode]. |
| 874 @DomName('OscillatorNode.onended') |
| 875 @DocsEditable() |
| 876 @Experimental() // untriaged |
| 877 Stream<Event> get onEnded => endedEvent.forTarget(this); |
| 878 } |
| 879 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 880 // for details. All rights reserved. Use of this source code is governed by a |
| 881 // BSD-style license that can be found in the LICENSE file. |
| 882 |
| 883 |
| 884 @DocsEditable() |
| 885 @DomName('PannerNode') |
| 886 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#PannerN
ode |
| 887 @Experimental() |
| 888 @Native("PannerNode,AudioPannerNode,webkitAudioPannerNode") |
| 889 class PannerNode extends AudioNode { |
| 890 // To suppress missing implicit constructor warnings. |
| 891 factory PannerNode._() { throw new UnsupportedError("Not supported"); } |
| 892 |
| 893 @DomName('PannerNode.coneInnerAngle') |
| 894 @DocsEditable() |
| 895 num coneInnerAngle; |
| 896 |
| 897 @DomName('PannerNode.coneOuterAngle') |
| 898 @DocsEditable() |
| 899 num coneOuterAngle; |
| 900 |
| 901 @DomName('PannerNode.coneOuterGain') |
| 902 @DocsEditable() |
| 903 num coneOuterGain; |
| 904 |
| 905 @DomName('PannerNode.distanceModel') |
| 906 @DocsEditable() |
| 907 String distanceModel; |
| 908 |
| 909 @DomName('PannerNode.maxDistance') |
| 910 @DocsEditable() |
| 911 num maxDistance; |
| 912 |
| 913 @DomName('PannerNode.panningModel') |
| 914 @DocsEditable() |
| 915 String panningModel; |
| 916 |
| 917 @DomName('PannerNode.refDistance') |
| 918 @DocsEditable() |
| 919 num refDistance; |
| 920 |
| 921 @DomName('PannerNode.rolloffFactor') |
| 922 @DocsEditable() |
| 923 num rolloffFactor; |
| 924 |
| 925 @DomName('PannerNode.setOrientation') |
| 926 @DocsEditable() |
| 927 void setOrientation(num x, num y, num z) native; |
| 928 |
| 929 @DomName('PannerNode.setPosition') |
| 930 @DocsEditable() |
| 931 void setPosition(num x, num y, num z) native; |
| 932 |
| 933 @DomName('PannerNode.setVelocity') |
| 934 @DocsEditable() |
| 935 void setVelocity(num x, num y, num z) native; |
| 936 } |
| 937 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 938 // for details. All rights reserved. Use of this source code is governed by a |
| 939 // BSD-style license that can be found in the LICENSE file. |
| 940 |
| 941 |
| 942 @DocsEditable() |
| 943 @DomName('PeriodicWave') |
| 944 @Experimental() // untriaged |
| 945 @Native("PeriodicWave") |
| 946 class PeriodicWave extends Interceptor { |
| 947 // To suppress missing implicit constructor warnings. |
| 948 factory PeriodicWave._() { throw new UnsupportedError("Not supported"); } |
| 949 } |
| 950 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 951 // for details. All rights reserved. Use of this source code is governed by a |
| 952 // BSD-style license that can be found in the LICENSE file. |
| 953 |
| 954 |
| 955 @DocsEditable() |
| 956 @DomName('ScriptProcessorNode') |
| 957 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ScriptP
rocessorNode |
| 958 @Experimental() |
| 959 @Native("ScriptProcessorNode,JavaScriptAudioNode") |
| 960 class ScriptProcessorNode extends AudioNode { |
| 961 // To suppress missing implicit constructor warnings. |
| 962 factory ScriptProcessorNode._() { throw new UnsupportedError("Not supported");
} |
| 963 |
| 964 /** |
| 965 * Static factory designed to expose `audioprocess` events to event |
| 966 * handlers that are not necessarily instances of [ScriptProcessorNode]. |
| 967 * |
| 968 * See [EventStreamProvider] for usage information. |
| 969 */ |
| 970 @DomName('ScriptProcessorNode.audioprocessEvent') |
| 971 @DocsEditable() |
| 972 @Experimental() // untriaged |
| 973 static const EventStreamProvider<AudioProcessingEvent> audioProcessEvent = con
st EventStreamProvider<AudioProcessingEvent>('audioprocess'); |
| 974 |
| 975 @DomName('ScriptProcessorNode.bufferSize') |
| 976 @DocsEditable() |
| 977 final int bufferSize; |
| 978 |
| 979 @DomName('ScriptProcessorNode.setEventListener') |
| 980 @DocsEditable() |
| 981 @Experimental() // untriaged |
| 982 void setEventListener(EventListener eventListener) native; |
| 983 |
| 984 /// Stream of `audioprocess` events handled by this [ScriptProcessorNode]. |
| 985 /** |
| 986 * Get a Stream that fires events when AudioProcessingEvents occur. |
| 987 * This particular stream is special in that it only allows one listener to a |
| 988 * given stream. Converting the returned Stream [asBroadcast] will likely ruin |
| 989 * the soft-real-time properties which which these events are fired and can |
| 990 * be processed. |
| 991 */ |
| 992 @DomName('ScriptProcessorNode.onaudioprocess') |
| 993 @DocsEditable() |
| 994 @Experimental() // untriaged |
| 995 Stream<AudioProcessingEvent> get onAudioProcess => audioProcessEvent.forTarget
(this); |
| 996 } |
| 997 // 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 |
| 999 // BSD-style license that can be found in the LICENSE file. |
| 1000 |
| 1001 |
| 1002 @DocsEditable() |
| 1003 @DomName('WaveShaperNode') |
| 1004 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#dfn-Wav
eShaperNode |
| 1005 @Experimental() |
| 1006 @Native("WaveShaperNode") |
| 1007 class WaveShaperNode extends AudioNode { |
| 1008 // To suppress missing implicit constructor warnings. |
| 1009 factory WaveShaperNode._() { throw new UnsupportedError("Not supported"); } |
| 1010 |
| 1011 @DomName('WaveShaperNode.curve') |
| 1012 @DocsEditable() |
| 1013 Float32List curve; |
| 1014 |
| 1015 @DomName('WaveShaperNode.oversample') |
| 1016 @DocsEditable() |
| 1017 String oversample; |
| 1018 } |
OLD | NEW |