--- 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

Specification Status Comment
{{SpecName('Web Audio API', '#idl-def-AudioScheduledSourceNode', 'AudioScheduledSourceNode')}} {{Spec2('Web Audio API')}}

Browser compatibility

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

See also