From bc24569b1c2a7d44dd0ff67b4ba480ad40300225 Mon Sep 17 00:00:00 2001 From: kubosho Date: Thu, 11 Dec 2014 21:46:00 +0900 Subject: [PATCH] Fix parameter type (when -> when?) --- CONTRIBUTORS.md | 2 +- webaudioapi/waa-tests.ts | 13 +++++++++++-- webaudioapi/waa.d.ts | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index becc0e9b30..8f69142ff3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -656,7 +656,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) -* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net) +* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho) * [:link:](webaudioapi/waa-nightly.d.ts) [Web Audio API (nightly)](http://www.w3.org/TR/2012/WD-webaudio-20120802) by [Baruch Berger](https://github.com/bbss) * [:link:](webmidi/webmidi.d.ts) [Web MIDI API](http://www.w3.org/TR/webmidi) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](devextreme/dx.webappjs.d.ts) [WebAppJS](http://js.devexpress.com/WebDevelopment) by [DevExpress Inc.](http://devexpress.com) diff --git a/webaudioapi/waa-tests.ts b/webaudioapi/waa-tests.ts index 20e49f8ea7..91c6114631 100644 --- a/webaudioapi/waa-tests.ts +++ b/webaudioapi/waa-tests.ts @@ -81,11 +81,20 @@ declare var footstepsBuffer: any; panner.connect(wet3); dry3.connect(masterDry); wet3.connect(reverb); - + // Start the sources now. source1.start(0); - source2.start(0); + // MEMO: should be when parameter is 0 + // http://www.w3.org/TR/webaudio/#AudioBufferSourceNode + source2.start(); source3.start(0); + + // Stop the sources are 2 seconds later. + source1.stop(2); + // MEMO: should be when parameter is 0 + // http://www.w3.org/TR/webaudio/#AudioBufferSourceNode + source2.stop(); + source3.stop(2); }; ()=>{ diff --git a/webaudioapi/waa.d.ts b/webaudioapi/waa.d.ts index 43aa8c4eaa..d6960bbb31 100644 --- a/webaudioapi/waa.d.ts +++ b/webaudioapi/waa.d.ts @@ -1,6 +1,6 @@ // Type definitions for Web Audio API // Project: http://www.w3.org/TR/webaudio/ -// Definitions by: Baruch Berger , Kon +// Definitions by: Baruch Berger , Kon , kubosho // Definitions: https://github.com/borisyankov/DefinitelyTyped /** @@ -545,14 +545,14 @@ interface AudioBufferSourceNode extends AudioSourceNode { * @param offset the offset time in the buffer (in seconds) where playback will begin. This parameter is optional with a default value of 0 (playing back from the beginning of the buffer). * @param duration the duration of the portion (in seconds) to be played. This parameter is optional, with the default value equal to the total duration of the AudioBuffer minus the offset parameter. Thus if neither offset nor duration are specified then the implied duration is the total duration of the AudioBuffer. */ - start(when: number, offset?: number, duration?: number): void; + start(when?: number, offset?: number, duration?: number): void; /** * Schedules a sound to stop playback at an exact time. Please see deprecation section for the old method name. * * The when parameter describes at what time (in seconds) the sound should stop playing. It is in the same time coordinate system as AudioContext.currentTime. If 0 is passed in for this value or if the value is less than currentTime, then the sound will stop playing immediately. stop must only be called one time and only after a call to start or stop, or an exception will be thrown. */ - stop(when: number): void; + stop(when?: number): void; } /*