Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyuagora committed Jul 8, 2024
1 parent 12c33e3 commit cdcc4c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions dita/RTC-NG/API/api_imediaengine_pullaudioframe.dita
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>调用该方法后,App 会采取主动拉取的方式获取远端已解码和混音后的音频数据,用于音频播放。</p>
<note type="attention">调用该方法前,你需要调用 <xref keyref="setExternalAudioSink"/><codeph>(<parmname>enabled</parmname>: <ph keyref="true"/>)</codeph> 开启并设置外部渲染。</note>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道后调用。</p>
<p>调用该方法前,你需要调用 <xref keyref="setExternalAudioSink"/><codeph>(<parmname>enabled</parmname>: <ph keyref="true"/>)</codeph> 开启并设置外部渲染。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
<p>该方法和 <xref keyref="onPlaybackAudioFrame"/> 回调均可用于获取远端混音后的音频播放数据。在调用 <apiname keyref="setExternalAudioSink"/> 开启外部音频渲染后,App 将无法从 <apiname keyref="onPlaybackAudioFrame"/> 回调中获得数据。因此,请根据实际的业务需求在该方法和 <apiname keyref="onPlaybackAudioFrame"/> 回调之间进行选择。二者的处理机制不同,具体区别如下:
<ul>
<li>调用该方法后,App 会主动拉取音频数据。通过设置音频数据,SDK 可以调整缓存,帮助 App 处理延时,从而有效避免音频播放抖动。</li>
<li>注册 <apiname keyref="onPlaybackAudioFrame"/> ,SDK 通过该回调将音频数据传输给 App。App 在处理音频帧的延迟时,可能会导致音频播放抖动。</li>
<li>注册 <apiname keyref="onPlaybackAudioFrame"/> 回调后,SDK 通过该回调将音频数据传输给 App。App 在处理音频帧的延迟时,可能会导致音频播放抖动。</li>
</ul></p>
<p>该方法仅用于拉取远端混音后的音频播放数据,如需获取采集的原始音频数据、混音前每条拉流单独的原始音频播放数据等,可以通过调用 <xref keyref="registerAudioFrameObserver"/> 注册相应的回调。</p>
</section>
<section id="parameters" deliveryTarget="details">
<title><ph props="android apple cpp unreal bp flutter unity cs">参数</ph></title>
<parml>
<parml props="android apple cpp unreal bp flutter unity cs">
<plentry props="cpp unreal bp unity flutter cs">
<pt>frame</pt>
<pd>指向 <xref keyref="AudioFrame"/> 的指针。</pd>
Expand Down
8 changes: 4 additions & 4 deletions dita/RTC-NG/API/api_imediaengine_pushaudioframe0.dita
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>调用该方法通过音频轨道推送外部音频帧。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>调用该方法推送外部音频数据前,请先进行以下操作:<ol>
<li>调用 <xref keyref="createCustomAudioTrack"/> 创建音频轨道并获得音频轨道 ID。</li>
<li>调用 <xref keyref="joinChannel2"/> 加入频道时,将 <xref keyref="ChannelMediaOptions"/> 中的 <parmname>publishCustomAudioTrackId</parmname> 设置为你想要发布的音频轨道 ID,并将 <parmname>publishCustomAudioTrack</parmname> 设置为 <codeph><ph keyref="true"/></codeph>。</li>
</ol></p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道后调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
Expand Down
8 changes: 4 additions & 4 deletions dita/RTC-NG/API/api_irtcengine_pushaudioframe2.dita
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
<codeblock props="reserve" outputclass="language-cpp"></codeblock></p>
</section>
<section id="detailed_desc" deliveryTarget="details" otherprops="no-title">
<p>调用该方法通过音频轨道推送外部音频帧。</p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>调用该方法推送外部音频数据前,请先进行以下操作:<ol>
<li>调用 <xref keyref="createCustomAudioTrack"/> 创建音频轨道并获得音频轨道 ID。</li>
<li>调用 <xref keyref="joinChannel2"/> 加入频道时,将 <xref keyref="ChannelMediaOptions"/> 中的 <parmname>publishCustomAudioTrackId</parmname> 设置为你想要发布的音频轨道 ID,并将 <parmname>publishCustomAudioTrack</parmname> 设置为 <codeph><ph keyref="true"/></codeph>。</li>
</ol></p>
</section>
<section id="timing" deliveryTarget="details">
<title>调用时机</title>
<p>该方法需要在加入频道后调用。</p>
</section>
<section id="restriction" deliveryTarget="details">
<title>调用限制</title>
Expand Down

0 comments on commit cdcc4c0

Please sign in to comment.