aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/mediastreamaudiosourcenode/index.html
blob: aa6c48ef86093b9e28e08c3fb7d704a55cd36937 (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
76
77
78
---
title: MediaStreamAudioSourceNode
slug: Web/API/MediaStreamAudioSourceNode
tags:
  - MediaStreamAudioSourceNode
  - Web Audio API
translation_of: Web/API/MediaStreamAudioSourceNode
---
<p>{{APIRef("Web Audio API")}}</p>

<div>
<p><code>MediaStreamAudioSourceNode</code> 接口代表一个音频接口,是<a href="/en-US/docs/WebRTC" title="/en-US/docs/WebRTC">WebRTC</a> {{domxref("MediaStream")}} (比如一个摄像头或者麦克风)的一部分。是个表现为音频源的{{domxref("AudioNode")}}</p>
</div>

<p><code>MediaElementSourceNode没有输入,并且只有一个输出。创建之后使用</code> {{domxref("AudioContext.createMediaStreamSource")}}方法。输出通道的数量和{{domxref("AudioMediaStreamTrack")}}的通道数量相同。如果没有有效的媒体流,输出通道就变成一个静音的通道。</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Number of inputs</th>
   <td><code>0</code></td>
  </tr>
  <tr>
   <th scope="row">Number of outputs</th>
   <td><code>1</code></td>
  </tr>
  <tr>
   <th scope="row">Channel count</th>
   <td>{{domxref("AudioMediaStreamTrack")}}定义,传递给 {{domxref("AudioContext.createMediaStreamSource")}} ,并由此创建。</td>
  </tr>
 </tbody>
</table>

<h2 id="构造器">构造器</h2>

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

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

<p><em></em><em>{{domxref("AudioNode")}}上继承。</em></p>

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

<p><em></em><em>{{domxref("AudioNode")}}上继承。</em></p>

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

<p>{{page("/zh-CN/docs/Web/API/AudioContext/createMediaStreamSource","示例")}}</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', '#the-mediastreamaudiosourcenode-interface', 'MediaStreamAudioSourceNode')}}</td>
   <td>{{Spec2('Web Audio API')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="兼容性">兼容性</h2>

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

<h2 id="See_also">See also</h2>

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