diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/audioscheduledsourcenode/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/audioscheduledsourcenode/index.html')
-rw-r--r-- | files/zh-cn/web/api/audioscheduledsourcenode/index.html | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/audioscheduledsourcenode/index.html b/files/zh-cn/web/api/audioscheduledsourcenode/index.html new file mode 100644 index 0000000000..88af23f58d --- /dev/null +++ b/files/zh-cn/web/api/audioscheduledsourcenode/index.html @@ -0,0 +1,81 @@ +--- +title: AudioScheduledSourceNode +slug: Web/API/AudioScheduledSourceNode +tags: + - API + - Audio + - AudioScheduledSourceNode + - Interface + - Media + - NeedsTranslation + - Reference + - TopicStub + - Web Audio API + - sound +translation_of: Web/API/AudioScheduledSourceNode +--- +<div>{{APIRef("Web Audio API")}}</div> + +<p><code>AudioScheduledSourceNode</code> 接口作为web音频API的一部分,是几种具有在特定时刻开始与停止能力的音频源节点接口的父接口。更具体地来说,这个接口定义了{{domxref("AudioScheduledSourceNode.start", "start()")}} 和{{domxref("AudioScheduledSourceNode.stop", "stop()")}} 方法,以及{{domxref("AudioScheduledSourceNode.onended", "onended")}}事件</p> + + + +<div class="note"> +<p>你不能直接创建<code>AudioScheduledSourceNode</code>。而是应该使用继承于它的子接口,如{{domxref("AudioBufferSourceNode")}}, {{domxref("OscillatorNode")}}和{{domxref("ConstantSourceNode")}}.</p> +</div> + +<p>除非另有说明,基于<code>AudioScheduledSourceNode</code>节点的输出在没有播放时处于静默状态(这种状态在start()之前与stop()之后调用)。静默状态总是由一个全0值流组成。</p> + +<h2 id="Properties">Properties</h2> + +<p><em>Inherits properties from its parent interface, {{domxref("AudioNode")}}, and adds the following properties:</em></p> + +<h3 id="Event_handlers">Event handlers</h3> + +<dl> + <dt>{{domxref("AudioScheduledSourceNode.onended", "onended")}}</dt> + <dd>A function to be called when the {{event("ended")}} event is fired, indicating that the node has finished playing.</dd> +</dl> + +<h2 id="Methods">Methods</h2> + +<p><em>Inherits methods from its parent interface, {{domxref("AudioNode")}}, and adds the following methods:</em></p> + +<dl> + <dt>{{domxref("AudioScheduledSourceNode.start", "start()")}}</dt> + <dd>Schedules the node to begin playing the constant sound at the specified time. If no time is specified, the node begins playing immediately.</dd> + <dt>{{domxref("AudioScheduledSourceNode.stop", "stop()")}}</dt> + <dd>Schedules the node to stop playing at the specified time. If no time is specified, the node stops playing at once.</dd> +</dl> + +<h2 id="Specification">Specification</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('Web Audio API', '#idl-def-AudioScheduledSourceNode', 'AudioScheduledSourceNode')}}</td> + <td>{{Spec2('Web Audio API')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div> + + +<p>{{Compat("api.AudioScheduledSourceNode")}}</p> +</div> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li> + <li>{{domxref("AudioNode")}}</li> +</ul> |