From 2d478fb11c4864129dffb10cb43630b2aaf26bc0 Mon Sep 17 00:00:00 2001 From: MDN Date: Tue, 29 Jun 2021 00:35:05 +0000 Subject: [CRON] sync translated content --- files/zh-cn/web/api/oscillatornode/stop/index.html | 121 --------------------- 1 file changed, 121 deletions(-) delete mode 100644 files/zh-cn/web/api/oscillatornode/stop/index.html (limited to 'files/zh-cn/web/api/oscillatornode/stop/index.html') diff --git a/files/zh-cn/web/api/oscillatornode/stop/index.html b/files/zh-cn/web/api/oscillatornode/stop/index.html deleted file mode 100644 index 3b776727b6..0000000000 --- a/files/zh-cn/web/api/oscillatornode/stop/index.html +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: OscillatorNode.stop() -slug: Web/API/OscillatorNode/stop -translation_of: Web/API/OscillatorNode/stop ---- -

{{ APIRef("Web Audio API") }}

- -
-

这个 stop方法 {{ domxref("OscillatorNode") }} 接口在指定时间内停止播放,它的参数是可选的,默认情况下是0.

-
- -

语法

- -
oscillator.stop(when); // stop playing oscillator at when
- -

参数

- -
-
when
-
An optional double representing the audio context time when the oscillator should stop. If a value is not included, it defaults to 0. If the time is equal to or before the current audio context time, the oscillator will stop playing immediately.
-
- -

例如

- -

下面的示例显示一个基本用法{{ domxref("AudioContext") }}创建子节点。一个应用的例子,看看我们的演示( Violent Theremin demo (see app.js for relevant code).

- -
// create web audio api context
-var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
-
-// create Oscillator node
-var oscillator = audioCtx.createOscillator();
-oscillator.connect(audioCtx.destination);
-
-oscillator.start();
-
-oscillator.stop(audioCtx.currentTime + 2); // stop 2 seconds after the current time
-
- -

规定

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Web Audio API', '#widl-OscillatorNode-stop-void-double-when', 'stop')}}{{Spec2('Web Audio API')}} 
- -

浏览器的兼容性

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support14 {{property_prefix("webkit")}}{{CompatVersionUnknown}}23 [1]{{CompatNo}}15 {{property_prefix("webkit")}}
- 22 (unprefixed)
6 {{property_prefix("webkit")}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChromeEdgeFirefox Mobile (Gecko)Firefox OSIE PhoneOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatVersionUnknown}}28 {{property_prefix("webkit")}}25 [1]1.2{{CompatNo}}{{CompatNo}}6 {{property_prefix("webkit")}}
-
- -

[1] The parameter wasn't optional until Firefox 30.

- -

See also

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