Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
f2451d9
update code style
Nov 3, 2023
1289981
[Android]add custom stream encrypt case.
xgfd3 Nov 13, 2023
b927036
[Android]update README links.
xgfd3 Nov 13, 2023
7ce610a
Dev/oc test (#353)
cleven1 Aug 12, 2023
dc0bca3
Dev/4.2.3 (#354)
xgfd3 Oct 12, 2023
a50dcdf
Update setLocalAccessPoint note and etc. (#358)
xgfd3 Nov 2, 2023
fdb98f2
Add gitee sync script.
xgfd3 Nov 13, 2023
258b55e
Update gitee sync script.
xgfd3 Nov 13, 2023
bcdbd86
Test gitee sync.
xgfd3 Nov 13, 2023
7ae9474
Merge branch 'dev/4.3.0' into jira/DEVEX-60
xgfd3 Nov 16, 2023
81c26ce
Merge pull request #359 from AgoraIO/jira/DEVEX-60
xgfd3 Nov 16, 2023
53dd609
Merge branch 'main' into dev/4.3.0
xgfd3 Nov 16, 2023
f07d63a
Feat/code style android (#366)
xgfd3 Nov 16, 2023
fcebcba
[Android]Adapt to 4.3.0 and add audio stream selector for media player.
xgfd3 Nov 16, 2023
dcba19c
[Android]Add face capture case and etc.
xgfd3 Nov 16, 2023
538b9eb
[Android][Audio]Adapt to 4.3.0 rtc sdk.
xgfd3 Nov 16, 2023
c2ef2d1
[Android]Update rtc version.
xgfd3 Nov 16, 2023
c96f608
Merge branch 'main' into dev/4.3.0
xgfd3 Nov 16, 2023
dbcb577
update sdk 4.3.0
Nov 17, 2023
752f8d3
iOS update SDK 4.3.0
Nov 17, 2023
55b939a
add multi audio track case
Nov 17, 2023
a282169
add face capture case
Nov 17, 2023
446e61e
[Windows]Adapt to 4.3.0, add audio stream selector for mediaplayer an…
xgfd3 Nov 17, 2023
08f3a9b
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Nov 17, 2023
f148f22
update sdk version to 4.3.0
Nov 20, 2023
199f5c5
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Nov 20, 2023
f057980
[Windows]add face capture case.
xgfd3 Nov 20, 2023
e18d64a
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Nov 20, 2023
2d8fcfe
[Android]update cpp include.
xgfd3 Nov 20, 2023
f6a2a50
[Android]Adapt to 4.3.0 latest version.
xgfd3 Nov 29, 2023
3bcf0ef
[Android]update cpp include.
xgfd3 Nov 29, 2023
69a8fda
[Android][Audio]Adapt to 4.3.0 latest version.
xgfd3 Nov 29, 2023
a9181f2
[windows]adapte to 4.3.0 latest version and fix bugs.
xgfd3 Nov 30, 2023
e57b819
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Nov 30, 2023
54aca01
fix rawVideo takesnpe crash bug
Dec 1, 2023
7595fe7
fix rawVideo snap shot bug
Dec 1, 2023
5a2b34b
fix medipa publish streaming bug
Dec 1, 2023
a8034a2
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Dec 1, 2023
c112613
[Android]try to fix NMS-17758 and etc.
xgfd3 Nov 30, 2023
8ccf4cf
[Android]fix bugs.
xgfd3 Dec 4, 2023
d983a9d
[Android]add background recording function for JoinChannelAudio case(…
xgfd3 Dec 6, 2023
fe1216f
[Android][Audio]add background recording function for JoinChannelAudi…
xgfd3 Dec 6, 2023
cb693eb
[Android]Adapt to 4.3.0 latest version.
xgfd3 Dec 6, 2023
f4672e9
[Android]fix custom audio render api call problem(DEVEX-65).
xgfd3 Dec 7, 2023
91db82e
fix multiChannel take snapshot bug
Dec 15, 2023
6d35ddc
fix custom video render bug
Dec 15, 2023
95d0de8
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Dec 15, 2023
22cdadd
update startEchoTest
Dec 21, 2023
7b570eb
[Windows] fix windows screen share bug.
xgfd3 Dec 21, 2023
8610da9
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Dec 21, 2023
f5442a0
update sdk document address
Dec 21, 2023
34b502b
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Dec 21, 2023
52f851c
[Windows]Add audio echo test user case.
xgfd3 Dec 21, 2023
6a74f01
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Dec 21, 2023
27f7377
[Android]Perfect basic video case and fix some bugs.
xgfd3 Dec 21, 2023
930e7dc
[Android]Perfect rtmp streaming case.
xgfd3 Dec 22, 2023
43405a8
Add Camera Test Fuction
Dec 26, 2023
0ba255e
[Android]Fix auido route bug.
Dec 26, 2023
58663bd
[Android]Add video echo test.
Dec 26, 2023
7b24802
[Android]fix echo test bug.
Dec 26, 2023
c4a8a51
[Android]perfect echo test example.
Dec 27, 2023
d37c726
add rtc connection state callback
Dec 27, 2023
31baed7
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Dec 27, 2023
1031a02
fix MediaPlayer publish stream UI bug
Dec 27, 2023
bda78f9
fix custom capture Video push bug
Jan 2, 2024
ca4950c
Fix the issue of self rendering on the Inter chip
Jan 3, 2024
964c25f
[windows]fix spatial audio zone bug.
xgfd3 Jan 4, 2024
2d2e425
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Jan 4, 2024
e4a07e6
fix custom video push bug
Jan 4, 2024
20b7492
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Jan 4, 2024
8f5d903
update precall test bug
cleven1 Jan 9, 2024
d0b3b62
[Windows]add video echo test api example.
xgfd3 Jan 10, 2024
5389d5f
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Jan 10, 2024
a2a2d21
[Windows]add basic join channel video by token example.
xgfd3 Jan 10, 2024
d93ccf7
[Windows]fix spatial audio zone bug(NMS-18784)
xgfd3 Jan 10, 2024
a5bf8d3
update start echo test
Jan 12, 2024
a6df626
update spatial audio method
Jan 12, 2024
f6f9cdf
[Android]fix audio problem.
Jan 12, 2024
f65da12
[Android][Audio]fix audio problem.
Jan 12, 2024
a031322
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Jan 12, 2024
077e5ae
update spatial audio remote user position
Jan 15, 2024
6fd3e98
Merge branch 'code_style' into dev/4.3.0
Jan 25, 2024
7394ac2
Optimize the code format
Jan 25, 2024
02459de
[Android]fix NMS-19192/NMS-19194.
xgfd3 Jan 30, 2024
1e3801a
[Android][Audio]fix NMS-19192.
xgfd3 Jan 30, 2024
7aabfbb
adapter video extension for v430 (#370)
DengQiming-private Jan 30, 2024
11c4166
update rtc sdk pod version to 4.3.0
Feb 22, 2024
5fdb1f0
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
Feb 22, 2024
6ff2703
Merge branch 'main' into dev/4.3.0
xgfd3 Feb 23, 2024
7053b81
[windows]Update sdk download url.
xgfd3 Feb 23, 2024
3b6fa87
Merge branch 'dev/4.3.0' of github.com:AgoraIO/API-Examples into dev/…
xgfd3 Feb 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.google.android.material.bottomsheet.BottomSheetDialog;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -52,6 +53,9 @@
import io.agora.spatialaudio.RemoteVoicePositionInfo;
import io.agora.spatialaudio.SpatialAudioZone;

/**
* The type Spatial sound.
*/
@Example(
index = 22,
group = ADVANCED,
Expand Down Expand Up @@ -94,7 +98,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
return;
}
try {
/**Creates an RtcEngine instance.
/*Creates an RtcEngine instance.
* @param context The context of Android Activity
* @param appId 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>
Expand All @@ -107,7 +111,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
config.mEventHandler = iRtcEngineEventHandler;
config.mAreaCode = ((MainApplication) getActivity().getApplication()).getGlobalSettings().getAreaCode();
engine = (RtcEngineEx) 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 Down Expand Up @@ -177,6 +181,7 @@ protected void onPositionChanged() {
float[] forward = new float[]{1.0F, 0.0F, 0.0F};
float[] right = new float[]{0.0F, 1.0F, 0.0F};
float[] up = new float[]{0.0F, 0.0F, 1.0F};
Log.d(TAG, "updateSelfPosition >> pos=" + Arrays.toString(pos));
localSpatial.updateSelfPosition(pos, forward, right, up);
}
});
Expand All @@ -202,11 +207,7 @@ protected void onPositionChanged() {
localSpatial.setZones(new SpatialAudioZone[]{mediaPlayerLeftZone});
} else {
zoneTv.setVisibility(View.INVISIBLE);
SpatialAudioZone worldZone = new SpatialAudioZone();
worldZone.upLength = AXIS_MAX_DISTANCE * 2;
worldZone.forwardLength = AXIS_MAX_DISTANCE * 2;
worldZone.rightLength = AXIS_MAX_DISTANCE * 2;
localSpatial.setZones(new SpatialAudioZone[]{worldZone});
localSpatial.setZones(null);
}
});
}
Expand All @@ -218,7 +219,7 @@ private void joinChannel() {

engine.setClientRole(io.agora.rtc2.Constants.CLIENT_ROLE_BROADCASTER);

/**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
Expand All @@ -228,7 +229,7 @@ private void joinChannel() {
ChannelMediaOptions option = new ChannelMediaOptions();
option.autoSubscribeAudio = true;

/** 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*/
int res = engine.joinChannel(ret, channelId, 0, option);
if (res != 0) {
Expand Down Expand Up @@ -298,7 +299,7 @@ private void initMediaPlayers() {
private void showMediaPlayerSettingDialog(IMediaPlayer mediaPlayer) {
String key = "MediaPlayer_" + mediaPlayer.getMediaPlayerId();
BottomSheetDialog dialog = cacheDialogs.get(key);
if(dialog != null){
if (dialog != null) {
dialog.show();
return;
}
Expand Down Expand Up @@ -345,7 +346,7 @@ public void onStopTrackingTouch(SeekBar seekBar) {
private void showRemoteUserSettingDialog(int uid) {
String key = "RemoteUser_" + uid;
BottomSheetDialog dialog = cacheDialogs.get(key);
if(dialog != null){
if (dialog != null) {
dialog.show();
return;
}
Expand Down Expand Up @@ -396,7 +397,6 @@ private void unInitMediaPlayers() {
private IMediaPlayer createLoopMediaPlayer() {
IMediaPlayer mediaPlayer = engine.createMediaPlayer();
mediaPlayer.registerPlayerObserver(new IMediaPlayerObserver() {

@Override
public void onPlayerStateChanged(Constants.MediaPlayerState state, Constants.MediaPlayerReason reason) {
if (state.equals(PLAYER_STATE_OPEN_COMPLETED)) {
Expand Down Expand Up @@ -475,22 +475,22 @@ private float[] getVoicePosition(View view) {
float transY = view.getTranslationY();
double posForward = -1 * AXIS_MAX_DISTANCE * transY / ((rootView.getHeight()) / 2.0f);
double posRight = AXIS_MAX_DISTANCE * transX / ((rootView.getWidth()) / 2.0f);
Log.d(TAG, "VoicePosition posForward=" + posForward + ", posRight=" + posRight);
//Log.d(TAG, "VoicePosition posForward=" + posForward + ", posRight=" + posRight);
return new float[]{(float) posForward, (float) posRight, 0.0F};
}

private float[] getViewRelativeSizeInAxis(View view) {
return new float[]{
AXIS_MAX_DISTANCE * view.getWidth() * 1.0f / (rootView.getWidth() / 2.0f),
AXIS_MAX_DISTANCE * view.getHeight() * 1.0f / (rootView.getHeight() / 2.0f) ,
AXIS_MAX_DISTANCE * view.getHeight() * 1.0f / (rootView.getHeight() / 2.0f),
};
}

private BottomSheetDialog showCommonSettingDialog(boolean isMute, SpatialAudioParams params,
CompoundButton.OnCheckedChangeListener muteCheckListener,
CompoundButton.OnCheckedChangeListener blurCheckListener,
CompoundButton.OnCheckedChangeListener airborneCheckListener,
SeekBar.OnSeekBarChangeListener attenuationSeekChangeListener
CompoundButton.OnCheckedChangeListener muteCheckListener,
CompoundButton.OnCheckedChangeListener blurCheckListener,
CompoundButton.OnCheckedChangeListener airborneCheckListener,
SeekBar.OnSeekBarChangeListener attenuationSeekChangeListener
) {
BottomSheetDialog dialog = new BottomSheetDialog(requireContext());
View dialogView = LayoutInflater.from(requireContext()).inflate(R.layout.dialog_spatial_sound, null);
Expand Down Expand Up @@ -581,20 +581,23 @@ public boolean onTouch(View v, MotionEvent event) {
v.setTranslationY(newTranY);
onPositionChanged();
break;
case MotionEvent.ACTION_UP:
default:
break;
}
return true;
}

/**
* On position changed.
*/
protected abstract void onPositionChanged();
}

/**
* IRtcEngineEventHandler is an abstract class providing default implementation.
* The SDK uses this class to report to the app on SDK runtime events.
*/
private class InnerRtcEngineEventHandler extends IRtcEngineEventHandler {
private final class InnerRtcEngineEventHandler extends IRtcEngineEventHandler {
@Override
public void onJoinChannelSuccess(String channel, int uid, int elapsed) {
super.onJoinChannelSuccess(channel, uid, elapsed);
Expand All @@ -617,8 +620,8 @@ public void onJoinChannelSuccess(String channel, int uid, int elapsed) {

/**
* 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 All @@ -643,7 +646,9 @@ public void onUserJoined(int uid, int elapsed) {
remoteLeftTv.setTag(uid);
remoteLeftTv.setVisibility(View.VISIBLE);
remoteLeftTv.setText(uid + "");
localSpatial.updateRemotePosition(uid, getVoicePositionInfo(remoteLeftTv));
RemoteVoicePositionInfo info = getVoicePositionInfo(remoteLeftTv);
Log.d(TAG, "left remote user >> pos=" + Arrays.toString(info.position));
localSpatial.updateRemotePosition(uid, info);

remoteLeftTv.setOnClickListener(v -> showRemoteUserSettingDialog(uid));
} else if (remoteRightTv.getTag() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

<TextView
android:id="@+id/tv_zone"
android:layout_width="100dp"
android:layout_height="200dp"
android:layout_width="130dp"
android:layout_height="230dp"
android:layout_gravity="center"
android:background="#88ff8800"
android:gravity="bottom"
Expand Down
4 changes: 2 additions & 2 deletions Android/APIExample/agora-simple-filter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ dependencies {
api fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ project(agora-simple-filter)
set(agora-lib-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-rtc-sdk.so)
link_libraries(${agora-lib-so})

set(agora-ffmpeg-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-ffmpeg.so)
link_libraries(${agora-ffmpeg-so})

set(agora-soundtouch-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-soundtouch.so)
link_libraries(${agora-soundtouch-so})

set(agora-fdkaac-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-fdkaac.so)
link_libraries(${agora-fdkaac-so})

#link opencv so
set(opencv-lib-so ${PROJECT_SOURCE_DIR}/../jniLibs/${CMAKE_ANDROID_ARCH_ABI}/libopencv_java4.so)
link_libraries(${opencv-lib-so})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ namespace agora {
if (!eglCore_) {
eglCore_ = new EglCore();
offscreenSurface_ = eglCore_->createOffscreenSurface(640, 320);

}
if (!eglCore_->isCurrent(offscreenSurface_)) {
eglCore_->makeCurrent(offscreenSurface_);
}
#endif
return true;
Expand All @@ -57,10 +53,36 @@ namespace agora {
return true;
}

bool WatermarkProcessor::makeCurrent() {
const std::lock_guard<std::mutex> lock(mutex_);
#if defined(__ANDROID__) || defined(TARGET_OS_ANDROID)
if (eglCore_ && offscreenSurface_) {
if (!eglCore_->isCurrent(offscreenSurface_)) {
eglCore_->makeCurrent(offscreenSurface_);
}
return true;
}
#endif
return false;
}

bool WatermarkProcessor::detachCurrent() {
const std::lock_guard<std::mutex> lock(mutex_);
#if defined(__ANDROID__) || defined(TARGET_OS_ANDROID)
if (eglCore_) {
eglCore_->makeNothingCurrent();
return true;
}
#endif
return false;
}

int WatermarkProcessor::processFrame(agora::rtc::VideoFrameData &capturedFrame) {
// PRINTF_INFO("processFrame: w: %d, h: %d, r: %d, enable: %d", capturedFrame.width, capturedFrame.height, capturedFrame.rotation, wmEffectEnabled_);
if (wmEffectEnabled_) {
makeCurrent();
addWatermark(capturedFrame);
detachCurrent();
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ namespace agora {

bool releaseOpenGL();

bool makeCurrent();

bool detachCurrent();

int processFrame(agora::rtc::VideoFrameData &capturedFrame);

int setParameters(std::string parameter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ private void stopPublish() {
* This method removes only one stream RTMP URL address each time it is called.*/
unpublishing = true;
retryTask.cancel(true);
retryTask = null;
engine.stopRtmpStream(et_url.getText().toString());
transcoding.removeUser(myUid);
}
Expand Down Expand Up @@ -564,28 +563,25 @@ public void onRtmpStreamingStateChanged(String url, int state, int errCode) {
} else if (state == Constants.RTMP_STREAM_PUBLISH_STATE_IDLE) {
if (unpublishing) {
unpublishing = false;
publishing = false;
/*Push stream not started or ended, make changes to the UI.*/
handler.post(() -> {
publish.setEnabled(true);
publish.setText(getString(R.string.publish));
transCodeSwitch.setEnabled(true);
});
}
// Retry logic
if (retryTask != null) {
if (retried >= MAX_RETRY_TIMES) {
retryTask.cancel(true);
retried = 0;
/*Push stream not started or ended, make changes to the UI.*/
handler.post(() -> {
publish.setEnabled(true);
publish.setText(getString(R.string.publish));
transCodeSwitch.setEnabled(true);
});
} else {
retried++;
startRtmpStreaming();
}
} else if (retried >= MAX_RETRY_TIMES) {
retryTask.cancel(true);
retried = 0;
/*Push stream not started or ended, make changes to the UI.*/
handler.post(() -> {
publish.setEnabled(true);
publish.setText(getString(R.string.publish));
transCodeSwitch.setEnabled(true);
});
} else {
retried++;
startRtmpStreaming();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.google.android.material.bottomsheet.BottomSheetDialog;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -180,6 +181,7 @@ protected void onPositionChanged() {
float[] forward = new float[]{1.0F, 0.0F, 0.0F};
float[] right = new float[]{0.0F, 1.0F, 0.0F};
float[] up = new float[]{0.0F, 0.0F, 1.0F};
Log.d(TAG, "updateSelfPosition >> pos=" + Arrays.toString(pos));
localSpatial.updateSelfPosition(pos, forward, right, up);
}
});
Expand All @@ -205,11 +207,7 @@ protected void onPositionChanged() {
localSpatial.setZones(new SpatialAudioZone[]{mediaPlayerLeftZone});
} else {
zoneTv.setVisibility(View.INVISIBLE);
SpatialAudioZone worldZone = new SpatialAudioZone();
worldZone.upLength = AXIS_MAX_DISTANCE * 2;
worldZone.forwardLength = AXIS_MAX_DISTANCE * 2;
worldZone.rightLength = AXIS_MAX_DISTANCE * 2;
localSpatial.setZones(new SpatialAudioZone[]{worldZone});
localSpatial.setZones(null);
}
});
}
Expand Down Expand Up @@ -477,7 +475,7 @@ private float[] getVoicePosition(View view) {
float transY = view.getTranslationY();
double posForward = -1 * AXIS_MAX_DISTANCE * transY / ((rootView.getHeight()) / 2.0f);
double posRight = AXIS_MAX_DISTANCE * transX / ((rootView.getWidth()) / 2.0f);
Log.d(TAG, "VoicePosition posForward=" + posForward + ", posRight=" + posRight);
//Log.d(TAG, "VoicePosition posForward=" + posForward + ", posRight=" + posRight);
return new float[]{(float) posForward, (float) posRight, 0.0F};
}

Expand Down Expand Up @@ -648,7 +646,9 @@ public void onUserJoined(int uid, int elapsed) {
remoteLeftTv.setTag(uid);
remoteLeftTv.setVisibility(View.VISIBLE);
remoteLeftTv.setText(uid + "");
localSpatial.updateRemotePosition(uid, getVoicePositionInfo(remoteLeftTv));
RemoteVoicePositionInfo info = getVoicePositionInfo(remoteLeftTv);
Log.d(TAG, "left remote user >> pos=" + Arrays.toString(info.position));
localSpatial.updateRemotePosition(uid, info);

remoteLeftTv.setOnClickListener(v -> showRemoteUserSettingDialog(uid));
} else if (remoteRightTv.getTag() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

<TextView
android:id="@+id/tv_zone"
android:layout_width="100dp"
android:layout_height="200dp"
android:layout_width="130dp"
android:layout_height="230dp"
android:layout_gravity="center"
android:background="#88ff8800"
android:gravity="bottom"
Expand Down