| 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' hide deprecated; | 8 import 'dart:_internal' hide deprecated; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 import 'dart:html_common'; | 10 import 'dart:html_common'; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 @DomName('AudioContext.createWaveShaper') | 355 @DomName('AudioContext.createWaveShaper') |
| 356 @DocsEditable() | 356 @DocsEditable() |
| 357 WaveShaperNode createWaveShaper() native; | 357 WaveShaperNode createWaveShaper() native; |
| 358 | 358 |
| 359 @JSName('decodeAudioData') | 359 @JSName('decodeAudioData') |
| 360 @DomName('AudioContext.decodeAudioData') | 360 @DomName('AudioContext.decodeAudioData') |
| 361 @DocsEditable() | 361 @DocsEditable() |
| 362 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac
k, [AudioBufferCallback errorCallback]) native; | 362 void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallbac
k, [AudioBufferCallback errorCallback]) native; |
| 363 | 363 |
| 364 @JSName('decodeAudioData') | |
| 365 @DomName('AudioContext.decodeAudioData') | |
| 366 @DocsEditable() | |
| 367 Future<AudioBuffer> decodeAudioData(ByteBuffer audioData) { | |
| 368 var completer = new Completer<AudioBuffer>(); | |
| 369 _decodeAudioData(audioData, | |
| 370 (value) { completer.complete(value); }, | |
| 371 (error) { completer.completeError(error); }); | |
| 372 return completer.future; | |
| 373 } | |
| 374 | |
| 375 @DomName('AudioContext.startRendering') | 364 @DomName('AudioContext.startRendering') |
| 376 @DocsEditable() | 365 @DocsEditable() |
| 377 void startRendering() native; | 366 void startRendering() native; |
| 378 | 367 |
| 379 /// Stream of `complete` events handled by this [AudioContext]. | 368 /// Stream of `complete` events handled by this [AudioContext]. |
| 380 @DomName('AudioContext.oncomplete') | 369 @DomName('AudioContext.oncomplete') |
| 381 @DocsEditable() | 370 @DocsEditable() |
| 382 Stream<Event> get onComplete => completeEvent.forTarget(this); | 371 Stream<Event> get onComplete => completeEvent.forTarget(this); |
| 383 | 372 |
| 384 factory AudioContext() => JS('AudioContext', | 373 factory AudioContext() => JS('AudioContext', |
| (...skipping 15 matching lines...) Expand all Loading... |
| 400 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, | 389 return JS('ScriptProcessorNode', '#.call(#, #, #, #)', function, this, |
| 401 bufferSize, numberOfInputChannels, numberOfOutputChannels); | 390 bufferSize, numberOfInputChannels, numberOfOutputChannels); |
| 402 } else if (numberOfInputChannels != null) { | 391 } else if (numberOfInputChannels != null) { |
| 403 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this, | 392 return JS('ScriptProcessorNode', '#.call(#, #, #)', function, this, |
| 404 bufferSize, numberOfInputChannels); | 393 bufferSize, numberOfInputChannels); |
| 405 } else { | 394 } else { |
| 406 return JS('ScriptProcessorNode', '#.call(#, #)', function, this, | 395 return JS('ScriptProcessorNode', '#.call(#, #)', function, this, |
| 407 bufferSize); | 396 bufferSize); |
| 408 } | 397 } |
| 409 } | 398 } |
| 399 @DomName('AudioContext.decodeAudioData') |
| 400 Future<AudioBuffer> decodeAudioData(ByteBuffer audioData) { |
| 401 var completer = new Completer<AudioBuffer>(); |
| 402 _decodeAudioData(audioData, |
| 403 (value) { completer.complete(value); }, |
| 404 (error) { |
| 405 if (error == null) { |
| 406 completer.completeError(''); |
| 407 } else { |
| 408 completer.completeError(error); |
| 409 } |
| 410 }); |
| 411 return completer.future; |
| 412 } |
| 410 } | 413 } |
| 411 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 414 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 412 // for details. All rights reserved. Use of this source code is governed by a | 415 // for details. All rights reserved. Use of this source code is governed by a |
| 413 // BSD-style license that can be found in the LICENSE file. | 416 // BSD-style license that can be found in the LICENSE file. |
| 414 | 417 |
| 415 | 418 |
| 416 @DocsEditable() | 419 @DocsEditable() |
| 417 @DomName('AudioDestinationNode') | 420 @DomName('AudioDestinationNode') |
| 418 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioDe
stinationNode-section | 421 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioDe
stinationNode-section |
| 419 @Experimental() | 422 @Experimental() |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 factory WaveShaperNode._() { throw new UnsupportedError("Not supported"); } | 1096 factory WaveShaperNode._() { throw new UnsupportedError("Not supported"); } |
| 1094 | 1097 |
| 1095 @DomName('WaveShaperNode.curve') | 1098 @DomName('WaveShaperNode.curve') |
| 1096 @DocsEditable() | 1099 @DocsEditable() |
| 1097 Float32List curve; | 1100 Float32List curve; |
| 1098 | 1101 |
| 1099 @DomName('WaveShaperNode.oversample') | 1102 @DomName('WaveShaperNode.oversample') |
| 1100 @DocsEditable() | 1103 @DocsEditable() |
| 1101 String oversample; | 1104 String oversample; |
| 1102 } | 1105 } |
| OLD | NEW |