Skip to content

Commit

Permalink
Merge branch 'master' into release/showroom
Browse files Browse the repository at this point in the history
  • Loading branch information
kelzr committed Sep 8, 2023
2 parents 8ad411d + 0fc2d71 commit 814392e
Show file tree
Hide file tree
Showing 243 changed files with 30,047 additions and 2,820 deletions.
92 changes: 74 additions & 18 deletions .github/workflows/python-app-4-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ jobs:
matrix:
platform: [flutter, ios, macos, electron, unity, rn]
working_dir: [../dita/RTC-NG, ../en-US/dita/RTC-NG]
staging_tag: ['', '-staging']
runs-on: ubuntu-latest
name: ${{matrix.platform}}${{matrix.staging_tag}} ${{matrix.working_dir == '../en-US/dita/RTC-NG' && '(en)' || '(cn)'}}
name: ${{matrix.platform}} ${{matrix.working_dir == '../en-US/dita/RTC-NG' && '(en)' || '(cn)'}}
steps:
- uses: actions/checkout@v3
- name: Set up python 3.8
Expand All @@ -28,8 +27,10 @@ jobs:
run: |
if [[ ${{ matrix.working_dir }} == *en-US* ]]; then
echo "language=en" >> $GITHUB_OUTPUT
else
echo "filename=${{matrix.platform}}_en_ng.json" >> $GITHUB_OUTPUT
else
echo "language=cn" >> $GITHUB_OUTPUT
echo "filename=${{matrix.platform}}_cn_ng.json" >> $GITHUB_OUTPUT
fi
- name: Get branch name
id: branch-name
Expand All @@ -42,28 +43,83 @@ jobs:
- name: Run ${{steps.matrix_vars.outputs.language}} JSON creation
run: |
cd xml2json
echo "Running for ${{matrix.platform}} NG"
if [[ "${{ matrix.staging_tag }}" == -staging ]]; then
python xml2json${{matrix.staging_tag}}.py --working_dir ${{matrix.working_dir}} --platform_tag ${{matrix.platform}};
else
python xml2json${{matrix.staging_tag}}.py --working_dir ${{matrix.working_dir}} --platform_tag ${{matrix.platform}} \
--json_file ${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json \
--sdk_type rtc-ng --remove_sdk_type rtc --defined_path ${{matrix.platform}}-ng;
fi
- name: Validate JSON File
run: python -m json.tool "xml2json/${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json" > /dev/null
python xml2json.py --working_dir ${{matrix.working_dir}} --platform_tag ${{matrix.platform}}\
--json_file ${{steps.matrix_vars.outputs.filename}}\
--language ${{steps.matrix_vars.outputs.language}}
- name: Validate and Order JSON File
run: jq 'sort_by(.'id')' "xml2json/${{steps.matrix_vars.outputs.filename}}" > ${{steps.matrix_vars.outputs.filename}}
- name: Upload ${{matrix.platform}} ${{steps.matrix_vars.outputs.language}} Artifact
uses: actions/upload-artifact@v3
with:
name: ${{matrix.platform}}_ng_json_template_${{ steps.matrix_vars.outputs.language }}${{matrix.staging_tag}}.json
path: xml2json/${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json
name: ${{matrix.platform}}_ng_json_template_${{steps.matrix_vars.outputs.language}}.json
path: ${{steps.matrix_vars.outputs.filename}}
- name: Upload ${{matrix.platform}} NG ${{steps.matrix_vars.outputs.language}} JSON to release
if: github.ref_name == github.event.repository.default_branch
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: xml2json/${{matrix.platform}}_${{steps.matrix_vars.outputs.language}}_ng.json
asset_name: ${{matrix.platform}}_ng_json_template_${{steps.matrix_vars.outputs.language}}${{matrix.staging_tag}}.json
tag: ${{ steps.branch-name.outputs.current_branch }}-build
file: ${{steps.matrix_vars.outputs.filename}}
asset_name: ${{matrix.platform}}_ng_json_template_${{steps.matrix_vars.outputs.language}}.json
tag: ${{steps.branch-name.outputs.current_branch}}-build
overwrite: true
body: "Template file for automatic comment population."
check_changed_files:
name: Check xml2json updated
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
outputs:
updated_xml: ${{steps.xml2json-changed.outputs.updated_xml}}
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v37
- name: Output Bool
id: xml2json-changed
run: echo "updated_xml=${{contains(steps.changed-files.outputs.all_changed_files, 'xml2json/xml2json.py')}}" >> $GITHUB_OUTPUT
compare:
name: Compare JSON Files
needs: [check_changed_files, build]
if: needs.check_changed_files.outputs.updated_xml
permissions:
pull-requests: read
runs-on: ubuntu-latest
strategy:
matrix:
platform: [flutter, ios, macos, electron, unity, rn]
language: [en, cn]
steps:
- name: Set up python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Download DocC Archive ⬇️
uses: actions/download-artifact@v3
with:
name: ${{matrix.platform}}_ng_json_template_${{matrix.language}}.json
path: artifacts
- name: Download current release
uses: robinraju/[email protected]
with:
tag: "master-build"
fileName: ${{matrix.platform}}_ng_json_template_${{matrix.language}}.json
- name: Check Sort by ID
run: |
# Sorting and moving newly generated JSON
jq 'sort_by(.'id')' "artifacts/${{matrix.platform}}_${{matrix.language}}_ng.json" > ${{matrix.platform}}_${{matrix.language}}_new.json
# mv artifacts/${{matrix.platform}}_${{matrix.language}}_ng.json ${{matrix.platform}}_${{matrix.language}}_new.json
# Sorting and moving latest release JSON
jq 'sort_by(.'id')' "${{matrix.platform}}_ng_json_template_${{matrix.language}}.json" > ${{matrix.platform}}_${{matrix.language}}_old.json
- name: Make Diff Compare File
run: |
set -e; diff -u ${{matrix.platform}}_${{matrix.language}}_old.json ${{matrix.platform}}_${{matrix.language}}_new.json -U 3 | tee comparison.txt > /dev/null
- name: Output Diff
run: |
if [[ ! -s comparison.txt ]]; then
echo "No differences found."
else
echo """
\`\`\`diff
$(cat comparison.txt)
\`\`\`
""" >> $GITHUB_STEP_SUMMARY
fi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public abstract int setPlayerAttenuation(int playerId, double attenuation, boolean forceSet);</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (int)setPlayerAttenuation:(double)attenuation playerId:(NSUInteger)playerId forceSet:(BOOL)forceSet;</codeblock>
<codeblock props="cpp unreal bp" outputclass="language-cpp">virtual int setPlayerAttenuation(int playerId, double attenuation, bool forceSet) = 0;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">virtual int setPlayerAttenuation(int playerId, double attenuation, bool forceSet) = 0;</codeblock>
<codeblock props="bp" outputclass="language-cpp">UFUNCTION(BlueprintCallable, Category = "Agora|ILocalSpatialAudioEngine")
int SetPlayerAttenuation(int playerId, bool forceSet, FString attenuation = "0.0");</codeblock>
<codeblock props="electron" outputclass="language-typescript">abstract setPlayerAttenuation(
playerId: number,
attenuation: number,
Expand Down
3 changes: 2 additions & 1 deletion dita/RTC-NG/API/api_ibasespatialaudioengine_setzones.dita
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
<parml>
<plentry>
<pt>zones</pt>
<pd>隔声区域的设置。详见 <apiname keyref="SpatialAudioZone"/>。</pd>
<pd>隔声区域的设置。详见 <apiname keyref="SpatialAudioZone"/>。
<note type="caution" props="cpp unreal bp unity cs flutter electron">在 Windows 平台上,需确保 <parmname>zones</parmname> 数组中的成员个数与 <parmname>zoneCount</parmname> 的值相等,否则会导致崩溃。</note></pd>
</plentry>
<plentry props="cpp framework">
<pt>zoneCount</pt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public abstract int setRemoteAudioAttenuation(int uid, double attenuation, boolean forceSet);</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (int) setRemoteAudioAttenuation:(double)attenuation userId:(NSUInteger)uid forceSet:(BOOL)forceSet;</codeblock>
<codeblock props="cpp unreal bp" outputclass="language-cpp">virtual int setRemoteAudioAttenuation(uid_t uid, double attenuation, bool forceSet) = 0;</codeblock>
<codeblock props="cpp unreal" outputclass="language-cpp">virtual int setRemoteAudioAttenuation(uid_t uid, double attenuation, bool forceSet) = 0;</codeblock>
<codeblock props="bp" outputclass="language-cpp">UFUNCTION(BlueprintCallable, Category = "Agora|ILocalSpatialAudioEngine")
int SetRemoteAudioAttenuation(int64 uid, bool forceSet, FString attenuation = "0.0");</codeblock>
<codeblock props="electron" outputclass="language-typescript">abstract setRemoteAudioAttenuation(
uid: number,
attenuation: number,
Expand Down
7 changes: 4 additions & 3 deletions dita/RTC-NG/API/api_imediaengine_createcustomaudiotrack.dita
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<reference id="api_imediaengine_createcustomaudiotrack">
<title><ph keyref="createCustomAudioTrack"/></title>
<shortdesc id="short"><ph id="shortdesc">创建一个自定义音频轨道。</ph></shortdesc>
<shortdesc id="short"><ph id="shortdesc">创建一个自定义音频采集轨道。</ph></shortdesc>
<prolog>
<metadata>
<keywords>
Expand Down Expand Up @@ -39,7 +39,7 @@
<dd>v4.2.0</dd>
</dlentry>
</dl>
<p>当你需要在频道中发布多路自定义采集音频时,可参考以下步骤:
<p>如需在频道中发布多路自定义采集音频,可参考以下步骤:
<ol>
<li>调用该方法创建音频轨道并获得音频轨道 ID。</li>
<li>在每个频道的 <xref keyref="ChannelMediaOptions"/> 中,将 <parmname>publishCustomAudioTrackId</parmname> 参数设置为你想要发布的音频轨道 ID,并将 <parmname>publishCustomAudioTrack</parmname> 设置为 <codeph><ph keyref="true"/></codeph>。</li>
Expand All @@ -51,7 +51,8 @@
<parml>
<plentry>
<pt>trackType</pt>
<pd>自定义音频轨道类型。详见 <xref keyref="AUDIO_TRACK_TYPE"/>。</pd>
<pd>自定义音频轨道类型。详见 <xref keyref="AUDIO_TRACK_TYPE"/>。
<note type="attention">如指定 <apiname keyref="AUDIO_TRACK_DIRECT"/>,则必须在调用 <xref keyref="joinChannel2"/> 加入频道时,将 <xref keyref="ChannelMediaOptions"/> 中的 <codeph>publishMicrophoneTrack</codeph> 设为 <codeph><ph keyref="false"/></codeph>,否则加入频道失败并返回错误码 -2.</note></pd>
</plentry>
<plentry>
<pt>config</pt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
<li>当用户自行调整分辨率时,回调中报告的分辨率也会变化。</li>
</ul></li>
</ul> </note>
<note type="tip" props="android ios cpp unreal bp unity flutter rn cs">注册原始视频观测器后,你可以将获取到的原始视频数据应用于各种视频前处理场景,例如自行实现虚拟背景、美颜等场景,声网在 GitHub 上提供了一些开源的示例项目供你参考。<ul>
<li><xref keyref="faceunity-link"/></li>
<li><xref keyref="bytedeffect-link"/></li></ul>
<note type="tip" props="android ios">注册原始视频观测器后,你可以将获取到的原始视频数据应用于各种视频前处理场景,例如自行实现虚拟背景、美颜等场景,声网在 GitHub 上提供了开源的示例项目 <xref keyref="beautyapi-link"/> 供你参考。
</note></section>
<section id="parameters">
<title>参数</title>
Expand Down
20 changes: 8 additions & 12 deletions dita/RTC-NG/API/api_imediaengine_setexternalaudiosource2.dita
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,48 @@
<refbody>
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public abstract int setExternalAudioSource(boolean enabled, int sampleRate, int channels,
int sourceNumber, boolean localPlayback, boolean publish);</codeblock>
<codeblock props="android" outputclass="language-java">public abstract int setExternalAudioSource(boolean enabled, int sampleRate, int channels, boolean localPlayback, boolean publish);</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (int)setExternalAudioSource:(BOOL)enabled
sampleRate:(NSInteger)sampleRate
channels:(NSInteger)channels
sourceNumber:(NSInteger)sourceNumber
localPlayback:(BOOL)localPlayback
publish:(BOOL)publish;</codeblock>
<codeblock props="cpp unreal bp" outputclass="language-cpp">virtual int setExternalAudioSource(bool enabled,
int sampleRate,
int channels,
int sourceNumber,
bool localPlayback = false,
bool publish = true) = 0;</codeblock>
<codeblock props="electron" outputclass="language-typescript">abstract setExternalAudioSource(
enabled: boolean,
sampleRate: number,
channels: number,
sourceNumber?: number,
localPlayback?: boolean,
publish?: boolean
): number;</codeblock>
<codeblock props="unity cs" outputclass="language-csharp">public abstract int SetExternalAudioSource(bool enabled, int sampleRate, int channels, int sourceNumber, bool localPlayback = false, bool publish = true);</codeblock>
<codeblock props="unity cs" outputclass="language-csharp">public abstract int SetExternalAudioSource(bool enabled, int sampleRate, int channels, bool localPlayback = false, bool publish = true);</codeblock>
<codeblock props="rn" outputclass="language-typescript">abstract setExternalAudioSource(
enabled: boolean,
sampleRate: number,
channels: number,
sourceNumber?: number,
localPlayback?: boolean,
publish?: boolean
): number;</codeblock>
<codeblock props="flutter" outputclass="language-dart">Future&lt;void> setExternalAudioSource(
{required bool enabled,
required int sampleRate,
required int channels,
int sourceNumber = 1,
bool localPlayback = false,
bool publish = true});</codeblock>
<codeblock props="reserve" outputclass="language-cpp"/></p>
</section>
<section id="detailed_desc">
<title>详情</title>
<dl outputclass="deprecated">
<dlentry>
<dt>弃用:</dt>
<dd>该方法已废弃,请改用 <xref keyref="createCustomAudioTrack" />。</dd>
</dlentry>
</dl>
<note type="attention">请在加入频道前调用该方法。</note> </section>
<section id="parameters">
<title>参数</title>
Expand All @@ -78,10 +78,6 @@
<pt>channels</pt>
<pd>外部音频源的声道数,可设置为 <codeph>1</codeph>(单声道)或 <codeph>2</codeph>(双声道)。</pd>
</plentry>
<plentry>
<pt>sourceNumber</pt>
<pd><ph>外部音频源的数量,取值为正整数。</ph><ph props="hide">多个音频源会被混音。</ph><ph>SDK 会根据该参数值创建对应数量的自采集音频轨道,并从 0 开始为音频轨道命名。你可以在 <xref keyref="ChannelMediaOptions"/> 中,设置 <parmname>publishCustomAudioTrackId</parmname> 为你想要发布的音频轨道 ID。</ph></pd>
</plentry>
<plentry>
<pt>localPlayback</pt>
<pd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
<codeblock props="android" outputclass="language-java">int registerAudioFrameObserver(IMediaPlayerAudioFrameObserver audioFrameObserver, int mode);
</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec"/>
<codeblock props="cpp unreal bp" outputclass="language-cpp">virtual int registerAudioFrameObserver(media::IAudioPcmFrameSink* observer,
<codeblock props="cpp unreal" outputclass="language-cpp">virtual int registerAudioFrameObserver(media::IAudioPcmFrameSink* observer,
RAW_AUDIO_FRAME_OP_MODE_TYPE mode) = 0;</codeblock>
<codeblock props="bp" outputclass="language-cpp">UFUNCTION(BlueprintCallable, Category = "Agora|IMediaPlayer")
int RegisterAudioFrameObserver(UIAudioPcmFrameSink* observer, ERAW_AUDIO_FRAME_OP_MODE_TYPE mode = ERAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY);</codeblock>
<codeblock props="electron" outputclass="language-typescript">abstract registerAudioFrameObserver(
observer: IAudioPcmFrameSink,
mode?: RawAudioFrameOpModeType
Expand Down Expand Up @@ -50,7 +52,7 @@
<p props="cpp unreal bp electron unity cs rn flutter">音频帧的使用模式,详见 <xref keyref="RAW_AUDIO_FRAME_OP_MODE_TYPE"/>。</p>
<p props="android" id="mode">音频帧的使用模式:
<ul>
<li><ph keyref="RAW_AUDIO_FRAME_OP_MODE_READ_ONLY"/> (0): 只读模式。例如: 若用户通过 SDK 采集数据,自己进行 RTMP 推流,则可以选择该模式。</li>
<li><ph keyref="RAW_AUDIO_FRAME_OP_MODE_READ_ONLY"/> (0): (默认) 只读模式。例如: 若用户通过 SDK 采集数据,自己进行 RTMP 推流,则可以选择该模式。</li>
<li><ph keyref="RAW_AUDIO_FRAME_OP_MODE_READ_WRITE"/> (2): 读写模式。例如:若用户自己有音效处理模块,且想要根据实际需要对数据进行前处理 (例如变声),则可以选择该模式。</li>
</ul> </p>
</pd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<section id="prototype">
<p outputclass="codeblock">
<codeblock props="android" outputclass="language-java">public abstract IAgoraMusicPlayer createMusicPlayer();</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (id&lt;AgoraMusicPlayerProtocol>)createMusicPlayerWithDelegate:(id&lt;AgoraRtcMediaPlayerDelegate>_Nullable)delegate NS_SWIFT_NAME(createMusicPlayer(delegate:));</codeblock>
<codeblock props="ios mac" outputclass="language-objectivec">- (id&lt;AgoraMusicPlayerProtocol> _Nullable)createMusicPlayerWithDelegate:(id&lt;AgoraRtcMediaPlayerDelegate> _Nullable)delegate NS_SWIFT_NAME(createMusicPlayer(delegate:));</codeblock>
<codeblock props="cpp unreal bp" outputclass="language-cpp">virtual agora_refptr&lt;IMusicPlayer> createMusicPlayer() = 0;</codeblock>
<codeblock props="electron" outputclass="language-typescript">abstract createMusicPlayer(): IMusicPlayer;</codeblock>
<codeblock props="unity cs" outputclass="language-csharp">public abstract IMusicPlayer CreateMusicPlayer();</codeblock>
Expand Down
2 changes: 1 addition & 1 deletion dita/RTC-NG/API/api_imusicontentcenter_preload.dita
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</section>
<section id="detailed_desc">
<title>详情</title>
<dl outputclass="deprecated">
<dl outputclass="deprecated" props="android ios cpp flutter unity rn">
<dlentry>
<dt>弃用:</dt>
<dd>该方法已废弃,请改用 <xref keyref="preload2"/>。</dd>
Expand Down
Loading

0 comments on commit 814392e

Please sign in to comment.