Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/4.2.0 #340

Merged
merged 170 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
4099203
[Android]fix bytedance beauty mirror bug
xgfd3 Feb 2, 2023
53e7a44
update Scene Beuaty
Feb 27, 2023
5d7744c
update Byte Beauty
Feb 27, 2023
6935ed2
update fu Beauty
Mar 7, 2023
be07960
Update README.zh.md
plutoless Feb 21, 2023
3cc8607
Update README.md
plutoless Feb 21, 2023
853636d
[Android]fix faceunity beauty bug(CSSA-1070)
xgfd3 Feb 24, 2023
a45f095
[Android]remove inaccurate comment.
xgfd3 Mar 8, 2023
0cbe4b3
[Android]perfect sense time beauty implement.
xgfd3 Mar 9, 2023
ef5f46d
[Android]adapte to 4.2.0.
xgfd3 Mar 17, 2023
2f6b322
Adaptive PCM acquisition
Mar 20, 2023
65d3994
Add Record Moudle
Mar 20, 2023
5ceed71
add voice formant adjust
Mar 20, 2023
316b43b
add video background effect
Mar 20, 2023
f23038f
[Android]add MediaRecorder case
xgfd3 Mar 20, 2023
721e819
Adaptive multi-channel camera
Mar 21, 2023
70bdf76
modify module name
Mar 21, 2023
340fc31
[Android]perfect MediaRecorder case
xgfd3 Mar 21, 2023
1015b52
choose screen share frameRate
Mar 21, 2023
e830051
add videoProcess remote alpha mask
Mar 21, 2023
4a66780
[Android]add LocalVideoTranscoding case.
xgfd3 Mar 21, 2023
73fcc79
[Android]add more voice configs for VoiceEffects
xgfd3 Mar 21, 2023
9ee1148
[Android]add virtual background video source type for VideoProcessExt…
xgfd3 Mar 21, 2023
8ebf771
[Android]add ScreenScenarioType selector for ScreenSharing.
xgfd3 Mar 21, 2023
cd34ceb
[Android]update rtc version to 4.2.0 in config files
xgfd3 Mar 21, 2023
1b0a588
[Android][Audio]adapt to 4.2.0 sdk.
xgfd3 Mar 21, 2023
76dad53
replace video source
Mar 22, 2023
84a31c3
Fit the 4.2.0 Mac SDK
Mar 22, 2023
22bad12
add local and remote record module
Mar 22, 2023
bb5a741
fix record stop bug
Mar 22, 2023
4168239
add virtual video background
Mar 22, 2023
10ba9a5
Mac Add local composite graph moudle
Mar 23, 2023
4c6dd12
add screen share fps choose
Mar 23, 2023
0c8ac16
open remote video alpha mask
Mar 23, 2023
65fd7c7
Fit the 4.2.0 audio-only SDK
Mar 23, 2023
b5810ba
set voice formant
Mar 23, 2023
81ee44c
modify mediaplayer url
Mar 23, 2023
a4f969f
update mac media player url
Mar 23, 2023
16a56ad
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Mar 23, 2023
2943c2b
[Windows]adapt to 420 sdk and add media recoder case.
xgfd3 Mar 23, 2023
9202f6d
[Windows]fix bugs of media recorder case.
xgfd3 Mar 23, 2023
7908334
update scene resouces
Mar 24, 2023
6f7aceb
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Mar 24, 2023
071caf5
[Windows]perfect local video transcoding case.
xgfd3 Mar 24, 2023
d2b8edc
[Windows]add voice conversion config to beauty audio case.
xgfd3 Mar 24, 2023
7c95e2e
[Windows]add virtual background type choices to beauty case.
xgfd3 Mar 24, 2023
238bffb
[Windows]add screen capture scenario config.
xgfd3 Mar 24, 2023
a4e9613
add video resource
Mar 24, 2023
fedb4d0
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Mar 24, 2023
70ad768
update video resource
Mar 24, 2023
6474c2c
[Android]update test video url and file reader.
xgfd3 Mar 24, 2023
86ff1bf
[Android]perfect local video transcoding case
xgfd3 Mar 24, 2023
d8b76ba
add smaplebufferredner init method
Mar 24, 2023
e19b59e
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Mar 24, 2023
4d01c88
add multi video track moudle
Mar 24, 2023
d9e6213
fix scene beauty change frameRate bug
Mar 27, 2023
c8cae60
update role bug
Mar 27, 2023
8b01b6f
fix rawVideoData snapshot bug
Mar 27, 2023
ed5a278
update save video path
Mar 27, 2023
0472ca7
update rtmp error bug
Mar 28, 2023
002a369
[Android]fix sceneTimeBeauty crash and default video resolution size …
xgfd3 Mar 28, 2023
d264d20
fix voice changer bug
Mar 28, 2023
ede992c
[Android]perfect third part beauty cases
xgfd3 Mar 28, 2023
51fb1d2
fix pcm play bug
Mar 28, 2023
b585a8b
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Mar 28, 2023
1efe2a0
[Android]fix NMS-11565
xgfd3 Mar 28, 2023
afc8a0e
update script
Mar 28, 2023
53ab9e8
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Mar 28, 2023
3d9f9b2
update script
Mar 28, 2023
bc1be1b
update exportplist file
Mar 28, 2023
0bc448c
update script
Mar 28, 2023
ef1fc5f
update scene bug
Mar 29, 2023
1ec3439
update exportPlist file
Mar 29, 2023
6967fcd
update exportplist file
Mar 29, 2023
d2570b3
update script
Mar 29, 2023
de440a0
update script
Mar 29, 2023
0d9e71b
[Android]perfect third part beauty cases
xgfd3 Mar 29, 2023
c03ea9b
[Android]fix setting crash
xgfd3 Mar 29, 2023
950077f
update script
Mar 30, 2023
cb06ab3
add logpath
Mar 30, 2023
0d0c1d4
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Mar 30, 2023
4ea9313
update script
Mar 30, 2023
1152ee3
update script
Mar 30, 2023
9ef5a91
update script
Mar 30, 2023
6cd4712
update script
Mar 30, 2023
37b5a31
update script
Mar 30, 2023
9c08ee1
pip remote video muted replace image
Mar 30, 2023
3346a81
update audio example bundle id
Mar 31, 2023
5f8a05a
update script
Mar 31, 2023
d45936b
update mac exportplist file
Apr 3, 2023
3cd7cff
fix mac raw video data snapshot bug
Apr 3, 2023
61d0715
update mac script
Apr 3, 2023
5f0eec7
update mac script
Apr 3, 2023
6035d92
update mac script
Apr 4, 2023
19a9110
update mac script
Apr 4, 2023
6217bb5
update mac script
Apr 4, 2023
305bc3b
update mac script
Apr 4, 2023
ac833ed
update mac script
Apr 4, 2023
b04bf32
update mac script
Apr 4, 2023
8eaafdc
update mac script
Apr 4, 2023
e5267df
update mac script
Apr 4, 2023
f75f1a9
update mac script
Apr 4, 2023
45ea3a8
update mac script
Apr 4, 2023
e30642d
[Windows]add PushExternalVideoYUV case.
xgfd3 Apr 5, 2023
35de9cb
[Windows]fix PushExternalVideoYUV bugs.
xgfd3 Apr 5, 2023
c2dcc85
[Windows]add MultiVideoSourceTracks case.
xgfd3 Apr 5, 2023
142dac0
update script
Apr 6, 2023
762c838
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Apr 6, 2023
5cc34ec
[Windows]perfect MultiVideoSourceTrack case and fix some bugs.
xgfd3 Apr 6, 2023
dbb67c5
[Windows]fix bug - NMS-11562
xgfd3 Apr 6, 2023
b121488
[Windows]fix yuv raw data bug.
xgfd3 Apr 6, 2023
f1b7105
[Android]add push video buffer type selector for PushExternalVideoYUV…
xgfd3 Apr 6, 2023
8db8924
[Android]update gradle config.
xgfd3 Apr 6, 2023
a83c8ed
[Android]fix beauty bug in arm64.
xgfd3 Apr 7, 2023
84e81a3
[Android]fix render bug in arm64
xgfd3 Apr 7, 2023
6af78a1
[Android]remove ndk filter limit.
xgfd3 Apr 7, 2023
2ecf33e
[Windows]fix crash of switching between LiveBroadcast and AgoraScreen…
xgfd3 Apr 7, 2023
862f245
[Windows]perfect screen sharing case(NMS-11314) and fix some bugs.
xgfd3 Apr 9, 2023
f14db5a
[Windows]fix sample res bug.
xgfd3 Apr 9, 2023
0ea9404
update mac readme
Apr 10, 2023
40c0ffb
update screen share exclude window params
Apr 10, 2023
105b3f6
update README
Apr 10, 2023
139ebe0
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Apr 10, 2023
c36a7f8
update README.
xgfd3 Apr 10, 2023
018feda
[Android]update README.
xgfd3 Apr 10, 2023
eed1e35
fix pip Android publish stream rotation 90°
Apr 10, 2023
29e73b4
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Apr 10, 2023
f0e3256
fix ci remove sources bug
Apr 14, 2023
96d627f
update sign mode
Apr 14, 2023
40a6769
update auto sign
Apr 14, 2023
c9bde92
update script
Apr 14, 2023
3887372
update script
Apr 14, 2023
6d42526
[Android]update byte dance camera facing config.
xgfd3 Apr 14, 2023
1b46f1d
fix pip display bug
Apr 14, 2023
3cd0a29
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Apr 14, 2023
45cf3fa
update beauty params
Apr 14, 2023
a57b4fa
Add pip version tips
Apr 14, 2023
782f0d7
[Android]perfect MultiVideoSourceTracks case and fix some bugs.
xgfd3 Apr 16, 2023
4f03a2a
[Windows]fix statistic display bug and etc.
xgfd3 Apr 17, 2023
1cef4c2
update recorder api
Apr 23, 2023
b08b468
update recorder api
Apr 24, 2023
d2b03ef
pip support BGRA encode
Apr 24, 2023
4924e9f
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Apr 24, 2023
6a37490
[Android]adjust MediaRecorder case and etc.
xgfd3 Apr 24, 2023
8a1cc3a
[Android]fix mirror bug of scene time and face unity.
xgfd3 Apr 24, 2023
87816c2
update english content
Apr 24, 2023
e515051
[Android]fix ci bug.
xgfd3 Apr 24, 2023
066a85c
[Windows]adjust media recorder api.
xgfd3 Apr 24, 2023
a56839e
support pip i420
Apr 26, 2023
bde53cb
update new sdk
Apr 28, 2023
3ba6252
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
Apr 28, 2023
fa443b4
update exportPlist file
Apr 28, 2023
2d1fe37
[Android]fix token/app id input bug.
xgfd3 May 6, 2023
5f08da4
[Android]fix push timestamp bug(NMS-12801)
xgfd3 May 6, 2023
39323c8
[Android]fix sensetime sticker oritation bug.
xgfd3 May 8, 2023
5b56066
enable filters
May 9, 2023
bd66b6f
fix custom capturer audio crash bug
May 9, 2023
ad44d71
fix mutil capturer video bug
May 9, 2023
a3127a1
fix custom video capturer publish streaming bug
May 10, 2023
e430c13
[Android]fix video filter invalid bug.
xgfd3 May 10, 2023
dc59ec4
[Android]remove publishCameraTrack=false
xgfd3 May 10, 2023
763c486
[Windows]fix beauty external bug.
xgfd3 May 10, 2023
cbda7d9
Adapt to new versions
May 11, 2023
2ea5b54
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
May 11, 2023
4d5a16d
[Windows]use timestamp of getCurrentMonotonicTimeInMs api to pushVide…
xgfd3 May 21, 2023
a57c1d5
update sdk version to 4.2.0
May 24, 2023
51f5749
Merge branch 'dev/4.2.0' of github.com:AgoraIO/API-Examples into dev/…
May 24, 2023
b63ddf8
[Windows]update sdk link.
xgfd3 May 24, 2023
41ffbb4
Merge branch 'main' into dev/4.2.0
xgfd3 May 25, 2023
8df4e95
update azure ci
xgfd3 May 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions .github/ci/build/build_ios_ipa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ TARGET_NAME=${PROJECT_PATH##*/}

KEYCENTER_PATH=${PROJECT_PATH}"/"${TARGET_NAME}"/Common/KeyCenter.swift"

METHOD_PATH=${PROJECT_PATH}"/ExportOptions.plist"

# 打包环境
CONFIGURATION=$method
CONFIGURATION="Debug"

#工程文件路径
APP_PATH="${PROJECT_PATH}/${TARGET_NAME}.xcworkspace"
Expand Down Expand Up @@ -65,8 +63,6 @@ echo PBXPROJ_PATH: $PBXPROJ_PATH
# Release
/usr/libexec/PlistBuddy -c "Set :objects:03D13BF82448758C00B599B3:buildSettings:CURRENT_PROJECT_VERSION ${BUILD_NUMBER}" $PBXPROJ_PATH

#修改打包方式
/usr/libexec/PlistBuddy -c "Set :method $CONFIGURATION" $METHOD_PATH

# 读取APPID环境变量
echo AGORA_APP_ID:$APP_ID
Expand All @@ -87,33 +83,39 @@ xcodebuild clean -workspace "${APP_PATH}" -configuration "${CONFIGURATION}" -sch
CURRENT_TIME=$(date "+%Y-%m-%d %H-%M-%S")

# 归档路径
ARCHIVE_PATH="${PROJECT_PATH}/${TARGET_NAME} ${CURRENT_TIME}/${TARGET_NAME}.xcarchive"
ARCHIVE_PATH="${WORKSPACE}/${TARGET_NAME}_${BUILD_NUMBER}.xcarchive"
# 编译环境

# 导出路径
EXPORT_PATH="${PROJECT_PATH}/${TARGET_NAME} ${CURRENT_TIME}"

# plist路径
PLIST_PATH="${PROJECT_PATH}/ExportOptions.plist"

echo PLIST_PATH: $PLIST_PATH

# archive 这边使用的工作区间 也可以使用project
xcodebuild archive -workspace "${APP_PATH}" -scheme "${TARGET_NAME}" -configuration "${CONFIGURATION}" -archivePath "${ARCHIVE_PATH}" -destination 'generic/platform=iOS'
xcodebuild CODE_SIGN_STYLE="Manual" archive -workspace "${APP_PATH}" -scheme "${TARGET_NAME}" clean CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -configuration "${CONFIGURATION}" -archivePath "${ARCHIVE_PATH}" -destination 'generic/platform=iOS' -quiet || exit

cd ${WORKSPACE}

# 导出ipa
xcodebuild -exportArchive -archivePath "${ARCHIVE_PATH}" -exportPath "${EXPORT_PATH}" -exportOptionsPlist "${PLIST_PATH}"
# 压缩archive
7za a -tzip "${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" "${ARCHIVE_PATH}"

# 签名
# sh sign "${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" --type xcarchive --plist "${PLIST_PATH}"
sh export "${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" --plist "${PLIST_PATH}"

# 上传IPA
7za a "$WORKSPACE/${TARGET_NAME}_${BUILD_NUMBER}_IPA.zip" -r "${EXPORT_PATH}/${TARGET_NAME}.ipa"
PAYLOAD_PATH="${TARGET_NAME}_${BUILD_NUMBER}_Payload"
mkdir "${PAYLOAD_PATH}"
# mv "${TARGET_NAME}_${BUILD_NUMBER}_iOS.ipa" "${PAYLOAD_PATH}"
mv "${TARGET_NAME}_${BUILD_NUMBER}.ipa" "${PAYLOAD_PATH}"

# 删除IPA文件夹
rm -rf "${EXPORT_PATH}"
7za a "${TARGET_NAME}_${BUILD_NUMBER}_IPA.zip" -r "${PAYLOAD_PATH}"
python3 artifactory_utils.py --action=upload_file --file="${TARGET_NAME}_${BUILD_NUMBER}_IPA.zip" --project

# rm -rf "${EXPORT_PATH}/${TARGET_NAME}.xcarchive"
# rm -rf "${EXPORT_PATH}/Packaging.log"
# rm -rf "${EXPORT_PATH}/ExportOptions.plist"
# rm -rf "${EXPORT_PATH}/DistributionSummary.plist"
# 删除IPA文件夹
rm -rf ${TARGET_NAME}_${BUILD_NUMBER}.xcarchive
rm -rf *.zip
rm -rf ${PAYLOAD_PATH}

#复原Keycenter文件
python3 /tmp/jenkins/api-examples/.github/ci/build/modify_ios_keycenter.py $KEYCENTER_PATH 1
Expand Down
2 changes: 1 addition & 1 deletion .github/ci/build/build_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ else
echo "failed"
exit 1
fi
cp -rf ./macOS/** ./$unzip_name/samples/APIExample
cp -a ./macOS/** ./$unzip_name/samples/APIExample
mv ./$unzip_name/samples/APIExample/sdk.podspec ./$unzip_name/
python3 ./.github/ci/build/modify_podfile.py ./$unzip_name/samples/APIExample/Podfile

Expand Down
27 changes: 12 additions & 15 deletions .github/ci/build/build_mac_ipa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TARGET_NAME=${PROJECT_PATH##*/}
KEYCENTER_PATH=${PROJECT_PATH}"/"${TARGET_NAME}"/Common/KeyCenter.swift"

# 打包环境
CONFIGURATION=developer-id
CONFIGURATION=Release

#工程文件路径
APP_PATH="${PROJECT_PATH}/${TARGET_NAME}.xcworkspace"
Expand Down Expand Up @@ -69,12 +69,9 @@ xcodebuild clean -workspace "${APP_PATH}" -configuration "${CONFIGURATION}" -sch
CURRENT_TIME=$(date "+%Y-%m-%d %H-%M-%S")

# 归档路径
ARCHIVE_PATH="${PROJECT_PATH}/${TARGET_NAME} ${CURRENT_TIME}/${TARGET_NAME}.xcarchive"
ARCHIVE_PATH="${WORKSPACE}/${TARGET_NAME}_${BUILD_NUMBER}.xcarchive"
# 编译环境

# 导出路径
EXPORT_PATH="${PROJECT_PATH}/${TARGET_NAME} ${CURRENT_TIME}"

# plist路径
PLIST_PATH="${PROJECT_PATH}/ExportOptions.plist"

Expand All @@ -83,20 +80,20 @@ echo PLIST_PATH: $PLIST_PATH
# archive 这边使用的工作区间 也可以使用project
xcodebuild archive -workspace "${APP_PATH}" -scheme "${TARGET_NAME}" -configuration "${CONFIGURATION}" -archivePath "${ARCHIVE_PATH}"

# 导出ipa
xcodebuild -exportArchive -archivePath "${ARCHIVE_PATH}" -exportPath "${EXPORT_PATH}" -exportOptionsPlist "${PLIST_PATH}"
cd ${WORKSPACE}

# 删除archive文件
rm -rf "${EXPORT_PATH}/${TARGET_NAME}.xcarchive"
rm -rf "${EXPORT_PATH}/Packaging.log"
rm -rf "${EXPORT_PATH}/ExportOptions.plist"
rm -rf "${EXPORT_PATH}/DistributionSummary.plist"
# 压缩archive
7za a -slp "${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" "${ARCHIVE_PATH}"

# 签名
sh sign "${WORKSPACE}/${TARGET_NAME}_${BUILD_NUMBER}.xcarchive.zip" --type xcarchive --plist "${PLIST_PATH}" --application macApp

# 上传IPA
7za a "$WORKSPACE/${TARGET_NAME}_Mac_${BUILD_NUMBER}_APP.zip" -r "${EXPORT_PATH}"
python3 artifactory_utils.py --action=upload_file --file="${TARGET_NAME}_${BUILD_NUMBER}.app.zip" --project

# 删除IPA文件夹
rm -rf "${EXPORT_PATH}"
# 删除archive文件
rm -rf ${TARGET_NAME}_${BUILD_NUMBER}.xcarchive
rm -rf *.zip

#复原Keycenter文件
python3 /tmp/jenkins/api-examples/.github/ci/build/modify_ios_keycenter.py $KEYCENTER_PATH 1
Expand Down
2 changes: 1 addition & 1 deletion Android/APIExample-Audio/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies {
implementation fileTree(dir: "${localSdkPath}", include: ['*.jar', '*.aar'])
}
else{
def agora_sdk_version = "4.1.1"
def agora_sdk_version = "4.2.0"
// case 1: full single lib with voice only
implementation "io.agora.rtc:voice-sdk:${agora_sdk_version}"
// case 2: partial libs with voice only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,27 @@
import static io.agora.rtc2.Constants.ULTRA_HIGH_QUALITY_VOICE;
import static io.agora.rtc2.Constants.VOICE_BEAUTIFIER_OFF;
import static io.agora.rtc2.Constants.VOICE_CHANGER_BASS;
import static io.agora.rtc2.Constants.VOICE_CHANGER_CARTOON;
import static io.agora.rtc2.Constants.VOICE_CHANGER_CHILDLIKE;
import static io.agora.rtc2.Constants.VOICE_CHANGER_CHIPMUNK;
import static io.agora.rtc2.Constants.VOICE_CHANGER_DARTH_VADER;
import static io.agora.rtc2.Constants.VOICE_CHANGER_EFFECT_BOY;
import static io.agora.rtc2.Constants.VOICE_CHANGER_EFFECT_GIRL;
import static io.agora.rtc2.Constants.VOICE_CHANGER_EFFECT_HULK;
import static io.agora.rtc2.Constants.VOICE_CHANGER_EFFECT_OLDMAN;
import static io.agora.rtc2.Constants.VOICE_CHANGER_EFFECT_PIGKING;
import static io.agora.rtc2.Constants.VOICE_CHANGER_EFFECT_SISTER;
import static io.agora.rtc2.Constants.VOICE_CHANGER_EFFECT_UNCLE;
import static io.agora.rtc2.Constants.VOICE_CHANGER_GIRLISH_MAN;
import static io.agora.rtc2.Constants.VOICE_CHANGER_GROOT;
import static io.agora.rtc2.Constants.VOICE_CHANGER_IRON_LADY;
import static io.agora.rtc2.Constants.VOICE_CHANGER_MONSTER;
import static io.agora.rtc2.Constants.VOICE_CHANGER_NEUTRAL;
import static io.agora.rtc2.Constants.VOICE_CHANGER_PHONE_OPERATOR;
import static io.agora.rtc2.Constants.VOICE_CHANGER_SHIN_CHAN;
import static io.agora.rtc2.Constants.VOICE_CHANGER_SOLID;
import static io.agora.rtc2.Constants.VOICE_CHANGER_SWEET;
import static io.agora.rtc2.Constants.VOICE_CHANGER_TRANSFORMERS;
import static io.agora.rtc2.Constants.VOICE_CONVERSION_OFF;

import android.content.Context;
Expand Down Expand Up @@ -97,7 +108,7 @@ public class VoiceEffects extends BaseFragment implements View.OnClickListener,
chatBeautifier, timbreTransformation, voiceChanger, styleTransformation, roomAcoustics, pitchCorrection, _pitchModeOption, _pitchValueOption, voiceConversion,
customBandFreq, customReverbKey;
private ViewGroup _voice3DLayout, _pitchModeLayout, _pitchValueLayout;
private SeekBar _voice3DCircle, customPitch, customBandGain, customReverbValue;
private SeekBar _voice3DCircle, customPitch, customBandGain, customReverbValue, customVoiceFormant;

private AudioSeatManager audioSeatManager;

Expand Down Expand Up @@ -159,10 +170,12 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
customBandGain = view.findViewById(R.id.audio_custom_band_gain); // engine.setLocalVoiceEqualization()
customReverbKey = view.findViewById(R.id.audio_custom_reverb_key);
customReverbValue = view.findViewById(R.id.audio_custom_reverb_value); //engine.setLocalVoiceReverb()
customVoiceFormant = view.findViewById(R.id.audio_voice_formant_value); //engine.setLocalVoiceFormant()

customPitch.setOnSeekBarChangeListener(this);
customBandGain.setOnSeekBarChangeListener(this);
customReverbValue.setOnSeekBarChangeListener(this);
customVoiceFormant.setOnSeekBarChangeListener(this);
customBandFreq.setOnItemSelectedListener(this);
customReverbKey.setOnItemSelectedListener(this);

Expand Down Expand Up @@ -194,6 +207,7 @@ private void resetControlLayoutByJoined() {
customBandGain.setEnabled(joined);
customReverbKey.setEnabled(joined);
customReverbValue.setEnabled(joined);
customVoiceFormant.setEnabled(joined);


chatBeautifier.setSelection(0);
Expand All @@ -206,6 +220,7 @@ private void resetControlLayoutByJoined() {
customPitch.setProgress(0);
customBandGain.setProgress(0);
customReverbValue.setProgress(0);
customVoiceFormant.setProgress(50);
}

@Override
Expand Down Expand Up @@ -407,8 +422,8 @@ private void joinChannel(String channelId) {
private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() {
/**
* Error code description can be found at:
* en: https://api-ref.agora.io/en/voice-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
* cn: https://docs.agora.io/cn/voice-call-4.x/API%20Reference/java_ng/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
* en: https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
* cn: https://docs.agora.io/cn/video-call-4.x/API%20Reference/java_ng/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
*/
@Override
public void onError(int err) {
Expand Down Expand Up @@ -617,6 +632,28 @@ private int getVoiceConversionValue(String label) {
return VOICE_CHANGER_SOLID;
case "VOICE_CHANGER_BASS":
return VOICE_CHANGER_BASS;
case "VOICE_CHANGER_CARTOON":
return VOICE_CHANGER_CARTOON;
case "VOICE_CHANGER_CHILDLIKE":
return VOICE_CHANGER_CHILDLIKE;
case "VOICE_CHANGER_PHONE_OPERATOR":
return VOICE_CHANGER_PHONE_OPERATOR;
case "VOICE_CHANGER_MONSTER":
return VOICE_CHANGER_MONSTER;
case "VOICE_CHANGER_TRANSFORMERS":
return VOICE_CHANGER_TRANSFORMERS;
case "VOICE_CHANGER_GROOT":
return VOICE_CHANGER_GROOT;
case "VOICE_CHANGER_DARTH_VADER":
return VOICE_CHANGER_DARTH_VADER;
case "VOICE_CHANGER_IRON_LADY":
return VOICE_CHANGER_IRON_LADY;
case "VOICE_CHANGER_SHIN_CHAN":
return VOICE_CHANGER_SHIN_CHAN;
case "VOICE_CHANGER_GIRLISH_MAN":
return VOICE_CHANGER_GIRLISH_MAN;
case "VOICE_CHANGER_CHIPMUNK":
return VOICE_CHANGER_CHIPMUNK;
case "VOICE_CONVERSION_OFF":
default:
return VOICE_CONVERSION_OFF;
Expand Down Expand Up @@ -743,6 +780,9 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (!fromUser) {
return;
}
if(seekBar == _voice3DCircle){
int cicle = (int) (1 + 59 * progress * 1.0f / seekBar.getMax());
// [1,60], 10 default
Expand Down Expand Up @@ -771,6 +811,10 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
value = (int) (100 * progress * 1.0f / seekBar.getMax());
}
engine.setLocalVoiceReverb(reverbKey, value);
} else if (seekBar == customVoiceFormant) {
// [-1, 1]
double value = (progress - 50) * 1.0f / 100;
engine.setLocalVoiceFormant(value);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public void onClick(View v) {
engine.leaveChannel();
pulling = false;
join.setText(getString(R.string.join));
audioSeatManager.downAllSeats();
if(pullingTask != null){
try {
pullingTask.join();
Expand Down Expand Up @@ -268,7 +269,7 @@ private void joinChannel(String channelId) {
* 0: Success.
* < 0: Failure.
* PS: Ensure that you call this method before the joinChannel method.*/
engine.setExternalAudioSource(true, SAMPLE_RATE, SAMPLE_NUM_OF_CHANNEL, 2, false, true);
// engine.setExternalAudioSource(true, SAMPLE_RATE, SAMPLE_NUM_OF_CHANNEL, 2, false, true);



Expand Down Expand Up @@ -303,9 +304,8 @@ private void joinChannel(String channelId) {
private final IRtcEngineEventHandler iRtcEngineEventHandler = new IRtcEngineEventHandler() {

/**
* Error code description can be found at:
* en: https://api-ref.agora.io/en/voice-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
* cn: https://docs.agora.io/cn/voice-call-4.x/API%20Reference/java_ng/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
* en: https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
* cn: https://docs.agora.io/cn/video-call-4.x/API%20Reference/java_ng/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onerror
*/
@Override
public void onError(int err) {
Expand Down
Loading