aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/mediaelementaudiosourcenode/index.html
blob: 990333f52b5eb933c1a8f3c6a106e263358264c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
title: MediaElementAudioSourceNode
slug: Web/API/MediaElementAudioSourceNode
translation_of: Web/API/MediaElementAudioSourceNode
---
<p>{{APIRef("Web Audio API")}}</p>

<div>
<p><code>MediaElementAudioSourceNode</code> 接口代表着某个由HTML5 {{ htmlelement("audio") }}{{ htmlelement("video") }} 元素所组成的音频源.该接口作为扮演音源的 {{domxref("AudioNode")}} 节点.</p>
</div>

<p><code>MediaElementSourceNode</code> 没有输入,只有一个输出,其由使用{{domxref("AudioContext.createMediaElementSource")}}方法创建.输出的频道数目与节点创建时引用音频 {{domxref("HTMLMediaElement")}}  的频道数目一致,或当 {{domxref("HTMLMediaElement")}} 无音频时,频道数目为 1.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">输入数目</th>
   <td><code>0</code></td>
  </tr>
  <tr>
   <th scope="row">输出数目</th>
   <td><code>1</code></td>
  </tr>
  <tr>
   <th scope="row">频道数</th>
   <td>由被传递给{{domxref("AudioContext.createMediaElementSource")}}{{domxref("HTMLMediaElement")}}内的音频定义.</td>
  </tr>
 </tbody>
</table>

<h2 id="构造函数">构造函数</h2>

<dl>
 <dt>{{domxref("MediaElementAudioSourceNode.MediaElementAudioSourceNode()")}}</dt>
 <dd>创建一个新的 <code>MediaElementAudioSourceNode</code> 实例.</dd>
</dl>

<h2 id="属性">属性</h2>

<p><em>集成其父类属性, </em><em>{{domxref("AudioNode")}}</em>.</p>

<h2 id="方法">方法</h2>

<p><em>集成其父类方法, {{domxref("AudioNode")}}</em>.</p>

<h2 id="示例">示例</h2>

<p>{{page("/zh-CN/docs/Web/API/AudioContext/createMediaElementSource","示例")}}</p>

<h2 id="规范">规范</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', '#MediaElementAudioSourceNode', 'MediaElementAudioSourceNode')}}</td>
   <td>{{Spec2('Web Audio API')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

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

<h2 id="相关页面">相关页面</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
</ul>