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.4.0 #390

Merged
merged 62 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
89b9849
[Android]Adapt to 4.4.0 sdk
xgfd3 Jun 14, 2024
eaa30b1
[Android][Audio]Adapt to 4.4.0 sdk.
xgfd3 Jun 14, 2024
0c09d0f
[Android][Compose]Adapt to 4.4.0 sdk.
xgfd3 Jun 14, 2024
86db972
[Android]1.add voiceAITuner config;2.add TransparentRendering case.
xgfd3 Jun 17, 2024
a326ac9
[Android]update sdk version in gradle config.
xgfd3 Jun 17, 2024
375bb62
[Android][Audio]add voice AI Tuner config to VoiceEffects case.
xgfd3 Jun 17, 2024
e95ca4b
[Windows]Adapt to 4.4.0.
xgfd3 Jun 17, 2024
d10be95
[windows] add ai tuner config.
xgfd3 Jun 17, 2024
07aec3c
feat: upgrade sdk to 4.4.0
tamworth Jun 17, 2024
4b003a9
feat: enable setup voice ai tuner
tamworth Jun 17, 2024
92ab8ef
feat: add new case(transparent render)
tamworth Jun 18, 2024
11b81ed
fix: clean rtc when leave room
tamworth Jun 18, 2024
787ded8
feat: add voice ai tuner to mac
tamworth Jun 18, 2024
f832e26
·fix: keycenter minor changes
tamworth Jun 18, 2024
471a723
Merge remote-tracking branch 'origin/dev/4.4.0' into dev/4.4.0_ios
tamworth Jun 18, 2024
3b026ea
[Android]Renew token service url.
xgfd3 Jun 24, 2024
85f61f9
feat: upgrade sdk to 4.4.0
tamworth Jun 17, 2024
f9799ee
feat: enable setup voice ai tuner
tamworth Jun 17, 2024
f6371d8
feat: add new case(transparent render)
tamworth Jun 18, 2024
8da4580
fix: clean rtc when leave room
tamworth Jun 18, 2024
e3b2595
feat: add voice ai tuner to mac
tamworth Jun 18, 2024
d351198
·fix: keycenter minor changes
tamworth Jun 18, 2024
b29e034
[FEAT] conditional import third party player in audio route
May 30, 2024
d028327
[iOS/Mac]Renew token service url.
xgfd3 Jun 24, 2024
4fa2357
fix: revert cert default value
tamworth Jun 24, 2024
73bfcbf
Merge remote-tracking branch 'origin/dev/4.4.0' into dev/4.4.0_ios
tamworth Jun 24, 2024
eacd6a6
fix: revert cert
tamworth Jun 24, 2024
11e16c3
Merge pull request #393 from AgoraIO/dev/4.4.0_ios
tamworth Jun 24, 2024
36712f8
fix: minor changes
tamworth Jun 24, 2024
d692735
fix: revert
tamworth Jun 24, 2024
9842be2
fix: remove -ld_classic
tamworth Jun 24, 2024
68d6375
Merge pull request #394 from AgoraIO/dev/4.4.0_ios
tamworth Jun 24, 2024
f3af557
[Android]fix tansparent rendering video bug.
xgfd3 Jun 24, 2024
0662ab7
[Android]update cpp include files.
xgfd3 Jun 27, 2024
d6b06d1
[Android]TansparentRendering add encodeAlpha config and etc
xgfd3 Jun 27, 2024
9a356cd
[Android][Compose]perfect audio route.
xgfd3 Jun 27, 2024
49f11ea
[iOS][OC]fix metadata receive crash(NMS-21946).
xgfd3 Jun 27, 2024
b80b9fc
[iOS]fix audio router player bug(NMS-21940).
xgfd3 Jun 27, 2024
a37ad70
[iOS]fix fusion CDN bug(NMS-21901).
xgfd3 Jun 27, 2024
1b65451
[Mac]fix take multi snapshot bug(NMS-21934).
xgfd3 Jun 27, 2024
bc036bb
[iOS]update ci build.
xgfd3 Jun 27, 2024
b84bc70
[Mac]fix CustomVideoSourcePushMulti render bug(NMS-21932).
xgfd3 Jun 30, 2024
1839b84
fix: pip dosent on iOS 15
tamworth Jul 1, 2024
bbc479a
Merge branch 'dev/4.4.0' of https://github.com/AgoraIO/API-Examples i…
tamworth Jul 1, 2024
b6bc776
[Windows]remove adative render mode choice.
xgfd3 Jul 1, 2024
412f5ba
fix: custom video source crash fixed
tamworth Jul 2, 2024
192c667
Merge branch 'dev/4.4.0' of https://github.com/AgoraIO/API-Examples i…
tamworth Jul 2, 2024
141232d
fix: fix for main thread hang during exit in funstion cdn
tamworth Jul 2, 2024
cd01b3a
[Android]fix sensetime beauty bug.
xgfd3 Jul 3, 2024
9f0eca4
fix: download file completion crash fixed
tamworth Jul 8, 2024
525616b
[Android]update ci build script.
Jul 14, 2024
7188796
fix: compile fail
tamworth Jul 15, 2024
02cd9a5
Merge branch 'dev/4.4.0' of https://github.com/AgoraIO/API-Examples i…
tamworth Jul 15, 2024
33c74cc
[Android]Add media player info display.
Jul 17, 2024
bad8485
[Android]perfect extension sample and update head include files.
Jul 18, 2024
6441a7b
fix: custom video render fix ui freeze
tamworth Jul 22, 2024
b4aa2e7
fix: custom render fix freeze
tamworth Jul 22, 2024
ae12f82
Merge branch 'dev/4.4.0' of https://github.com/AgoraIO/API-Examples i…
tamworth Jul 22, 2024
314ee76
fix: play samples fixed
tamworth Jul 24, 2024
07e1153
[Android][Compose]rename audio basic case file name.
Aug 6, 2024
05c08d5
fix: rename class
tamworth Aug 6, 2024
adc10a4
Merge branch 'dev/4.4.0' of https://github.com/AgoraIO/API-Examples i…
tamworth Aug 6, 2024
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
2 changes: 1 addition & 1 deletion Android/APIExample-Audio/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'

def localSdkPath= "${rootProject.projectDir.absolutePath}/../../sdk"
def agoraSdkVersion = '4.3.2'
def agoraSdkVersion = '4.4.0'

android {
compileSdkVersion 32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
import io.agora.rtc2.RtcEngineConfig;
import io.agora.rtc2.proxy.LocalAccessPointConfiguration;

/**
* The type Voice effects.
*/
@Example(
index = 4,
group = ADVANCED,
Expand All @@ -106,7 +109,7 @@ public class VoiceEffects extends BaseFragment implements View.OnClickListener,
private EditText et_channel;
private Button join;
private Spinner audioProfile, audioScenario,
chatBeautifier, timbreTransformation, voiceChanger, styleTransformation, roomAcoustics, pitchCorrection, _pitchModeOption, _pitchValueOption, voiceConversion, ainsMode,
chatBeautifier, timbreTransformation, voiceChanger, styleTransformation, roomAcoustics, pitchCorrection, _pitchModeOption, _pitchValueOption, voiceConversion, ainsMode, voiceAITuner,
customBandFreq, customReverbKey;
private ViewGroup _voice3DLayout, _pitchModeLayout, _pitchValueLayout;
private SeekBar _voice3DCircle, customPitch, customBandGain, customReverbValue, customVoiceFormant;
Expand Down Expand Up @@ -154,6 +157,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
_pitchValueOption = view.findViewById(R.id.audio_pitch_value_option);
voiceConversion = view.findViewById(R.id.audio_voice_conversion);
ainsMode = view.findViewById(R.id.audio_ains_mode);
voiceAITuner = view.findViewById(R.id.voice_ai_tuner);

chatBeautifier.setOnItemSelectedListener(this);
timbreTransformation.setOnItemSelectedListener(this);
Expand All @@ -166,6 +170,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
_pitchModeOption.setOnItemSelectedListener(this);
_pitchValueOption.setOnItemSelectedListener(this);
ainsMode.setOnItemSelectedListener(this);
voiceAITuner.setOnItemSelectedListener(this);

// Customize Voice Effects Layout
customPitch = view.findViewById(R.id.audio_custom_pitch); // engine.setLocalVoicePitch()
Expand Down Expand Up @@ -205,6 +210,7 @@ private void resetControlLayoutByJoined() {
_pitchValueLayout.setVisibility(View.GONE);
voiceConversion.setEnabled(joined);
ainsMode.setEnabled(joined);
voiceAITuner.setEnabled(joined);

customPitch.setEnabled(joined);
customBandFreq.setEnabled(joined);
Expand Down Expand Up @@ -238,30 +244,30 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
}
try {
RtcEngineConfig config = new RtcEngineConfig();
/**
/*
* The context of Android Activity
*/
config.mContext = context.getApplicationContext();
/**
/*
* The App ID issued to you by Agora. See <a href="https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id"> How to get the App ID</a>
*/
config.mAppId = getString(R.string.agora_app_id);
/** Sets the channel profile of the Agora RtcEngine.
/* Sets the channel profile of the Agora RtcEngine.
CHANNEL_PROFILE_COMMUNICATION(0): (Default) The Communication profile.
Use this profile in one-on-one calls or group calls, where all users can talk freely.
CHANNEL_PROFILE_LIVE_BROADCASTING(1): The Live-Broadcast profile. Users in a live-broadcast
channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams;
an audience can only receive streams.*/
config.mChannelProfile = Constants.CHANNEL_PROFILE_LIVE_BROADCASTING;
/**
/*
* IRtcEngineEventHandler is an abstract class providing default implementation.
* The SDK uses this class to report to the app on SDK runtime events.
*/
config.mEventHandler = iRtcEngineEventHandler;
config.mAudioScenario = Constants.AudioScenario.getValue(Constants.AudioScenario.DEFAULT);
config.mAreaCode = ((MainApplication)getActivity().getApplication()).getGlobalSettings().getAreaCode();
config.mAreaCode = ((MainApplication) getActivity().getApplication()).getGlobalSettings().getAreaCode();
engine = RtcEngine.create(config);
/**
/*
* This parameter is for reporting the usages of APIExample to agora background.
* Generally, it is not necessary for you to set this parameter.
*/
Expand All @@ -288,7 +294,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
@Override
public void onDestroy() {
super.onDestroy();
/**leaveChannel and Destroy the RtcEngine instance*/
/*leaveChannel and Destroy the RtcEngine instance*/
if (engine != null) {
engine.leaveChannel();
}
Expand All @@ -312,15 +318,14 @@ public void onClick(View v) {
AndPermission.with(this).runtime().permission(
Permission.Group.STORAGE,
Permission.Group.MICROPHONE
).onGranted(permissions ->
{
).onGranted(permissions -> {
// Permissions Granted
joinChannel(channelId);
}).start();
} else {
joined = false;
resetControlLayoutByJoined();
/**After joining a channel, the user must call the leaveChannel method to end the
/*After joining a channel, the user must call the leaveChannel method to end the
* call before joining another channel. This method returns 0 if the user leaves the
* channel and releases all resources related to the call. This method call is
* asynchronous, and the user has not exited the channel when the method call returns.
Expand Down Expand Up @@ -389,21 +394,21 @@ private int getPitch2Value(String str) {
* Users that input the same channel name join the same channel.
*/
private void joinChannel(String channelId) {
/**In the demo, the default is to enter as the anchor.*/
/*In the demo, the default is to enter as the anchor.*/
engine.setClientRole(Constants.CLIENT_ROLE_BROADCASTER);
// audio config
engine.setAudioProfile(
Constants.AudioProfile.getValue(Constants.AudioProfile.valueOf(audioProfile.getSelectedItem().toString())),
Constants.AudioScenario.getValue(Constants.AudioScenario.valueOf(audioScenario.getSelectedItem().toString()))
);

/**Please configure accessToken in the string_config file.
/*Please configure accessToken in the string_config file.
* A temporary token generated in Console. A temporary token is valid for 24 hours. For details, see
* https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token
* A token generated at the server. This applies to scenarios with high-security requirements. For details, see
* https://docs.agora.io/en/cloud-recording/token_server_java?platform=Java*/
TokenUtils.gen(requireContext(), channelId, 0, accessToken -> {
/** Allows a user to join a channel.
/* Allows a user to join a channel.
if you do not specify the uid, we will generate the uid for you*/

ChannelMediaOptions option = new ChannelMediaOptions();
Expand Down Expand Up @@ -588,7 +593,7 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long

for (Spinner spinner : voiceBeautifierSpinner) {
if (spinner != parent) {
if(spinner.getSelectedItemPosition() != 0){
if (spinner.getSelectedItemPosition() != 0) {
spinner.setTag("reset");
spinner.setSelection(0);
}
Expand All @@ -605,33 +610,33 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long

for (Spinner spinner : audioEffectSpinner) {
if (spinner != parent) {
if(spinner.getSelectedItemPosition() != 0){
if (spinner.getSelectedItemPosition() != 0) {
spinner.setTag("reset");
spinner.setSelection(0);
}
}
}

_voice3DLayout.setVisibility(audioEffectPreset == ROOM_ACOUSTICS_3D_VOICE ? View.VISIBLE: View.GONE);
_voice3DLayout.setVisibility(audioEffectPreset == ROOM_ACOUSTICS_3D_VOICE ? View.VISIBLE : View.GONE);
_pitchModeLayout.setVisibility(audioEffectPreset == PITCH_CORRECTION ? View.VISIBLE : View.GONE);
_pitchValueLayout.setVisibility(audioEffectPreset == PITCH_CORRECTION ? View.VISIBLE : View.GONE);
return;
}

if(parent == voiceConversion){
if (parent == voiceConversion) {
String item = parent.getSelectedItem().toString();
engine.setVoiceConversionPreset(getVoiceConversionValue(item));
return;
}


if(parent == _pitchModeOption || parent == _pitchValueOption){
if (parent == _pitchModeOption || parent == _pitchValueOption) {
int effectOption1 = getPitch1Value(_pitchModeOption.getSelectedItem().toString());
int effectOption2 = getPitch2Value(_pitchValueOption.getSelectedItem().toString());
engine.setAudioEffectParameters(PITCH_CORRECTION, effectOption1, effectOption2);
}

if(parent == ainsMode){
if (parent == ainsMode) {
boolean enable = position > 0;
/*
The AI noise suppression modes:
Expand All @@ -644,6 +649,12 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
*/
engine.setAINSMode(enable, position - 1);
}

if (parent == voiceAITuner) {
boolean enable = position > 0;
String item = parent.getSelectedItem().toString();
engine.enableVoiceAITuner(enable, enable ? Constants.VOICE_AI_TUNER_TYPE.valueOf(item) : Constants.VOICE_AI_TUNER_TYPE.VOICE_AI_TUNER_MATURE_MALE);
}
}

private int getVoiceConversionValue(String label) {
Expand Down Expand Up @@ -672,7 +683,7 @@ private int getVoiceConversionValue(String label) {
return VOICE_CHANGER_DARTH_VADER;
case "VOICE_CHANGER_IRON_LADY":
return VOICE_CHANGER_IRON_LADY;
case "VOICE_CHANGER_SHIN_CHAN":
case "VOICE_CHANGER_SHIN_CHAN":
return VOICE_CHANGER_SHIN_CHAN;
case "VOICE_CHANGER_GIRLISH_MAN":
return VOICE_CHANGER_GIRLISH_MAN;
Expand Down Expand Up @@ -807,11 +818,11 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (!fromUser) {
return;
}
if(seekBar == _voice3DCircle){
if (seekBar == _voice3DCircle) {
int cicle = (int) (1 + 59 * progress * 1.0f / seekBar.getMax());
// [1,60], 10 default
engine.setAudioEffectParameters(ROOM_ACOUSTICS_3D_VOICE, cicle, 0);
}else if(seekBar == customPitch){
} else if (seekBar == customPitch) {
double pitch = 0.5 + 1.5 * progress * 1.0f / seekBar.getMax();
// pitch: [0.5,2.0], 1.0 default
engine.setLocalVoicePitch(pitch);
Expand All @@ -827,11 +838,11 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
// AUDIO_REVERB_ROOM_SIZE(2):[0, 100] dB
// AUDIO_REVERB_WET_DELAY(3):Wet signal, [0, 200] ms
// AUDIO_REVERB_STRENGTH(4): [0, 100]
if(reverbKey == Constants.AUDIO_REVERB_TYPE.AUDIO_REVERB_DRY_LEVEL || reverbKey == Constants.AUDIO_REVERB_TYPE.AUDIO_REVERB_WET_LEVEL){
if (reverbKey == Constants.AUDIO_REVERB_TYPE.AUDIO_REVERB_DRY_LEVEL || reverbKey == Constants.AUDIO_REVERB_TYPE.AUDIO_REVERB_WET_LEVEL) {
value = (int) (-20 + 30 * progress * 1.0f / seekBar.getMax());
}else if(reverbKey == Constants.AUDIO_REVERB_TYPE.AUDIO_REVERB_WET_DELAY){
} else if (reverbKey == Constants.AUDIO_REVERB_TYPE.AUDIO_REVERB_WET_DELAY) {
value = (int) (200 * progress * 1.0f / seekBar.getMax());
}else {
} else {
value = (int) (100 * progress * 1.0f / seekBar.getMax());
}
engine.setLocalVoiceReverb(reverbKey, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static void gen(String appId, String certificate, String channelName, in
}

Request request = new Request.Builder()
.url("https://test-toolbox.bj2.agoralab.co/v1/token/generate")
.url("https://service.agora.io/toolbox-global/v1/token/generate")
.addHeader("Content-Type", "application/json")
.post(RequestBody.create(postBody.toString(), null))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,29 @@

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:gravity="center_vertical">

<TextView
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="Voice AI Tuner"
android:textColor="@android:color/black" />

<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/voice_ai_tuner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:entries="@array/voice_ai_tuner"
android:spinnerMode="dropdown" />

</LinearLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
14 changes: 14 additions & 0 deletions Android/APIExample-Audio/app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,18 @@
<item>AINS_MODE_AGGRESSIVE</item>
<item>AINS_MODE_ULTRALOWLATENCY</item>
</string-array>

<string-array name="voice_ai_tuner">
<item>OFF</item>
<item>VOICE_AI_TUNER_MATURE_MALE</item>
<item>VOICE_AI_TUNER_FRESH_MALE</item>
<item>VOICE_AI_TUNER_ELEGANT_FEMALE</item>
<item>VOICE_AI_TUNER_SWEET_FEMALE</item>
<item>VOICE_AI_TUNER_WARM_MALE_SINGING</item>
<item>VOICE_AI_TUNER_GENTLE_FEMALE_SINGING</item>
<item>VOICE_AI_TUNER_HUSKY_MALE_SINGING</item>
<item>VOICE_AI_TUNER_WARM_ELEGANT_FEMALE_SINGING</item>
<item>VOICE_AI_TUNER_POWERFUL_MALE_SINGING</item>
<item>VOICE_AI_TUNER_DREAMY_FEMALE_SINGING</item>
</string-array>
</resources>
4 changes: 4 additions & 0 deletions Android/APIExample-Audio/cloud_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# cache gradle to /tmp/.gradle
ls ~/.gradle || (mkdir -p /tmp/.gradle && ln -s /tmp/.gradle ~/.gradle && touch ~/.gradle/ln_$(date "+%y%m%d%H") && ls ~/.gradle)

#change android maven to china repos
sed -ie "s#google()#maven { url \"https\://maven.aliyun.com/repository/public\" }\n google()#g" settings.gradle
sed -ie "s#https://services.gradle.org/distributions#https://mirrors.cloud.tencent.com/gradle#g" gradle/wrapper/gradle-wrapper.properties

## config appId
sed -i -e "s#YOUR APP ID#${APP_ID}#g" app/src/main/res/values/string_configs.xml
sed -i -e "s#YOUR APP CERTIFICATE##g" app/src/main/res/values/string_configs.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ class CustomVideoRenderRender(
0,
0,
viewportWidth,
viewportHeight
viewportHeight,
0
)
} catch (exception: NullPointerException) {
Log.e(TAG, "skip empty buffer!")
Expand Down
Loading
Loading