From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/audioscheduledsourcenode/index.html | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 files/zh-cn/web/api/audioscheduledsourcenode/index.html (limited to 'files/zh-cn/web/api/audioscheduledsourcenode/index.html') 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 +--- +
{{APIRef("Web Audio API")}}
+ +

AudioScheduledSourceNode 接口作为web音频API的一部分,是几种具有在特定时刻开始与停止能力的音频源节点接口的父接口。更具体地来说,这个接口定义了{{domxref("AudioScheduledSourceNode.start", "start()")}} 和{{domxref("AudioScheduledSourceNode.stop", "stop()")}} 方法,以及{{domxref("AudioScheduledSourceNode.onended", "onended")}}事件

+ + + +
+

你不能直接创建AudioScheduledSourceNode。而是应该使用继承于它的子接口,如{{domxref("AudioBufferSourceNode")}}, {{domxref("OscillatorNode")}}和{{domxref("ConstantSourceNode")}}.

+
+ +

除非另有说明,基于AudioScheduledSourceNode节点的输出在没有播放时处于静默状态(这种状态在start()之前与stop()之后调用)。静默状态总是由一个全0值流组成。

+ +

Properties

+ +

Inherits properties from its parent interface, {{domxref("AudioNode")}}, and adds the following properties:

+ +

Event handlers

+ +
+
{{domxref("AudioScheduledSourceNode.onended", "onended")}}
+
A function to be called when the {{event("ended")}} event is fired, indicating that the node has finished playing.
+
+ +

Methods

+ +

Inherits methods from its parent interface, {{domxref("AudioNode")}}, and adds the following methods:

+ +
+
{{domxref("AudioScheduledSourceNode.start", "start()")}}
+
Schedules the node to begin playing the constant sound at the specified time. If no time is specified, the node begins playing immediately.
+
{{domxref("AudioScheduledSourceNode.stop", "stop()")}}
+
Schedules the node to stop playing at the specified time. If no time is specified, the node stops playing at once.
+
+ +

Specification

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Audio API', '#idl-def-AudioScheduledSourceNode', 'AudioScheduledSourceNode')}}{{Spec2('Web Audio API')}}
+ +

Browser compatibility

+ +
+ + +

{{Compat("api.AudioScheduledSourceNode")}}

+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf