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.3 #354

Merged
merged 58 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bbcab7b
add third player moudle
Aug 22, 2023
0829c64
add Audio Waveform Moudle
Aug 24, 2023
2456acb
Fixed an issue where remote users joined player pause when rtc and pl…
Sep 7, 2023
2843983
fix ui issue
Sep 8, 2023
b9a7e8c
update content inspect config
Sep 11, 2023
c86dca5
add Feature Available On Device
Sep 11, 2023
f7b447e
add take snapshot ex
Sep 11, 2023
f2f8f60
update beautyAPI version to 1.0.3
Sep 11, 2023
fadeb22
add Feature Available On Device
Sep 11, 2023
7363855
add snapshot ex
Sep 11, 2023
30d7224
fix snapshot remote bug
Sep 11, 2023
e04af7c
[Android]Add AudioRouterPlayer case.
xgfd3 Aug 30, 2023
0806301
[Android]Add AudioWaveform case.
xgfd3 Aug 30, 2023
eaac1c5
[Android][Audio]add AudioWaveform case.
xgfd3 Aug 30, 2023
c6bc746
[Android]adjust content inspect case.
xgfd3 Sep 11, 2023
d6ec2ed
[Android]Add isFeatureAvailableOnDevice api in VideoProcessExtension.
xgfd3 Sep 11, 2023
e4c33ac
[Android]Add takesnapshotex for JoinMultipleChannel.
xgfd3 Sep 11, 2023
a44cc0c
[Android]update beauty api to 1.0.3 and etc.
xgfd3 Sep 11, 2023
51261de
[Windows]add snapshot for MultiChannel.
xgfd3 Sep 11, 2023
470b1c0
[Windows]fix snapshot bug.
xgfd3 Sep 11, 2023
5a25c47
fix oc crate stream data bug
Sep 12, 2023
6eed57d
fix swift create stream data bug
Sep 12, 2023
013c4bb
[Android]fix remote render error when rejoining channel(NMS-15581).
xgfd3 Sep 14, 2023
34a6355
[Android]perfect PushExternalVideoYUV case.
xgfd3 Sep 14, 2023
cb30098
add file sharing key
Sep 14, 2023
7625e78
fix title
Sep 14, 2023
ed3d06f
fix multi channel bug
Sep 14, 2023
8f6f43e
fix conent inspect bug
Sep 14, 2023
b2a00b6
[Windows]fix media player crash.
xgfd3 Sep 14, 2023
528ec69
[Android]perfect MultiVideoSourceTracks case.
xgfd3 Sep 14, 2023
f9c38ce
fix input token crash bug
Sep 14, 2023
e44d429
fix input token crash bug
Sep 14, 2023
b9aef50
[Android]Update readme. (#355)
xgfd3 Sep 14, 2023
a115dc9
[Android]add 4K 60fps h265. (#356)
xgfd3 Sep 14, 2023
8602102
[Android]fix ui bug.
xgfd3 Sep 15, 2023
ac97852
[Android]fix render bug(CSD-59845).
xgfd3 Sep 15, 2023
c90e2ab
Fix the issue of no sound during AVPlayer playback
Sep 15, 2023
fcd5460
Merge branch 'dev/4.2.3' of github.com:AgoraIO/API-Examples into dev/…
Sep 15, 2023
f68aac4
[Android]add cases of enableVideoImageSource and setAINSMode api and …
xgfd3 Sep 22, 2023
68f7694
[Android]add setAINSMode api case and etc.
xgfd3 Sep 22, 2023
b7d0627
add video image push
Sep 22, 2023
3d893ca
add AINS Mode
Sep 22, 2023
12a0ac2
iOS Add AINS Mode
Sep 22, 2023
b95b279
ios add video image push
Sep 22, 2023
ed64a7d
[Windows]add enableVideoImageSource and setAINSMode api case.
xgfd3 Sep 23, 2023
73c7098
Merge branch 'dev/4.2.3' of github.com:AgoraIO/API-Examples into dev/…
Sep 26, 2023
0195245
[MacOS]fix audio recording path bug.
xgfd3 Oct 3, 2023
30a00ae
fix startAudioRecording path bug
Oct 8, 2023
6c65cea
fix audio session change issue
Oct 8, 2023
f62be74
Merge branch 'dev/4.2.3' of github.com:AgoraIO/API-Examples into dev/…
Oct 8, 2023
4303e02
fix video image source issue
Oct 9, 2023
f3a194d
..
Oct 9, 2023
0081c67
fix exit screen leave channel issue
Oct 9, 2023
5551dcb
screen shareing auto close system interface
Oct 11, 2023
d812398
[Android]update rtc verstion and etc.
xgfd3 Oct 12, 2023
d75a622
[Windows]Update rtc verstion.
xgfd3 Oct 12, 2023
e1ac4d3
update SDK version to 4.2.3
Oct 12, 2023
118b2fb
Merge branch 'dev/4.2.3' of github.com:AgoraIO/API-Examples into dev/…
Oct 12, 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
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.2.2"
def agora_sdk_version = "4.2.3"
// 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 @@ -98,6 +98,7 @@ private void runOnPermissionGranted(@NonNull Runnable runnable) {
permissionList.add(Permission.WRITE_EXTERNAL_STORAGE);
permissionList.add(Permission.RECORD_AUDIO);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
permissionList.add(Manifest.permission.READ_PHONE_STATE);
permissionList.add(Manifest.permission.BLUETOOTH_CONNECT);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
package io.agora.api.example.common.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.view.View;

import androidx.annotation.Nullable;

import java.util.ArrayList;

import io.agora.api.example.R;

public class WaveformView extends View {
private ArrayList<Short> datas = new ArrayList<>();
private short max = 100;
private float mWidth;
private float mHeight;
private float space =1f;
private Paint mWavePaint;
private Paint baseLinePaint;
private int mWaveColor = Color.WHITE;
private int mBaseLineColor = Color.WHITE;
private float waveStrokeWidth = 4f;
private int invalidateTime = 1000 / 100;
private long drawTime;
private boolean isMaxConstant = false;

public WaveformView(Context context) {
this(context, null);
}

public WaveformView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}

public WaveformView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(attrs, defStyleAttr);
}

private void init(AttributeSet attrs, int defStyle) {
final TypedArray a = getContext().obtainStyledAttributes(
attrs, R.styleable.WaveView, defStyle, 0);
mWaveColor = a.getColor(
R.styleable.WaveView_waveColor,
mWaveColor);
mBaseLineColor = a.getColor(
R.styleable.WaveView_baselineColor,
mBaseLineColor);

waveStrokeWidth = a.getDimension(
R.styleable.WaveView_waveStokeWidth,
waveStrokeWidth);

max = (short) a.getInt(R.styleable.WaveView_maxValue, max);
invalidateTime = a.getInt(R.styleable.WaveView_invalidateTime, invalidateTime);

space = a.getDimension(R.styleable.WaveView_space, space);
a.recycle();
initPainters();

}

private void initPainters() {
mWavePaint = new Paint();
mWavePaint.setColor(mWaveColor);// 画笔为color
mWavePaint.setStrokeWidth(waveStrokeWidth);// 设置画笔粗细
mWavePaint.setAntiAlias(true);
mWavePaint.setFilterBitmap(true);
mWavePaint.setStrokeCap(Paint.Cap.ROUND);
mWavePaint.setStyle(Paint.Style.FILL);
Shader shader = new LinearGradient(0, 0, 1000, 0, 0xffffffff, 0xFFe850ee, Shader.TileMode.CLAMP);
mWavePaint.setShader(shader);
baseLinePaint = new Paint();
baseLinePaint.setColor(mBaseLineColor);// 画笔为color
baseLinePaint.setStrokeWidth(1f);// 设置画笔粗细
baseLinePaint.setAntiAlias(true);
baseLinePaint.setFilterBitmap(true);
baseLinePaint.setStyle(Paint.Style.FILL);
}

public short getMax() {
return max;
}

public void setMax(short max) {
this.max = max;
}

public float getSpace() {
return space;
}

public void setSpace(float space) {
this.space = space;
}

public int getmWaveColor() {
return mWaveColor;
}

public void setmWaveColor(int mWaveColor) {
this.mWaveColor = mWaveColor;
invalidateNow();
}

public int getmBaseLineColor() {
return mBaseLineColor;
}

public void setmBaseLineColor(int mBaseLineColor) {
this.mBaseLineColor = mBaseLineColor;
invalidateNow();
}

public float getWaveStrokeWidth() {
return waveStrokeWidth;
}

public void setWaveStrokeWidth(float waveStrokeWidth) {
this.waveStrokeWidth = waveStrokeWidth;
invalidateNow();
}

public int getInvalidateTime() {
return invalidateTime;
}

public void setInvalidateTime(int invalidateTime) {
this.invalidateTime = invalidateTime;
}

public boolean isMaxConstant() {
return isMaxConstant;
}

public void setMaxConstant(boolean maxConstant) {
isMaxConstant = maxConstant;
}

/**
* 如果改变相应配置 需要刷新相应的paint设置
*/
public void invalidateNow() {
initPainters();
invalidate();
}

public void addData(short data) {

if (data < 0) {
data = (short) -data;
}
if (data > max && !isMaxConstant) {
max = data;
}
if (datas.size() > mWidth / space) {
synchronized (this) {
datas.remove(0);
datas.add(data);
}
} else {
datas.add(data);
}
if (System.currentTimeMillis() - drawTime > invalidateTime) {
invalidate();
drawTime = System.currentTimeMillis();
}

}

public void clear() {
datas.clear();
invalidateNow();
}


@Override
protected void onDraw(Canvas canvas) {
canvas.translate(0, mHeight / 2);
drawBaseLine(canvas);
drawWave(canvas);
}

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
mWidth = w;
mHeight = h;
}

private void drawWave(Canvas mCanvas) {
for (int i = 0; i < datas.size(); i++) {
float x = (i) * space;
float y = (float) datas.get(i) / max * mHeight / 2;
mCanvas.drawLine(x, -y, x, y, mWavePaint);
}

}

private void drawBaseLine(Canvas mCanvas) {
mCanvas.drawLine(0, 0, mWidth, 0, baseLinePaint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,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,
chatBeautifier, timbreTransformation, voiceChanger, styleTransformation, roomAcoustics, pitchCorrection, _pitchModeOption, _pitchValueOption, voiceConversion, ainsMode,
customBandFreq, customReverbKey;
private ViewGroup _voice3DLayout, _pitchModeLayout, _pitchValueLayout;
private SeekBar _voice3DCircle, customPitch, customBandGain, customReverbValue, customVoiceFormant;
Expand Down Expand Up @@ -152,6 +152,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
_pitchValueLayout = view.findViewById(R.id.audio_pitch_value_layout);
_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);

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

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

customPitch.setEnabled(joined);
customBandFreq.setEnabled(joined);
Expand All @@ -216,6 +219,7 @@ private void resetControlLayoutByJoined() {
roomAcoustics.setSelection(0);
pitchCorrection.setSelection(0);
voiceConversion.setSelection(0);
ainsMode.setSelection(0);

customPitch.setProgress(0);
customBandGain.setProgress(0);
Expand Down Expand Up @@ -615,11 +619,26 @@ public void onItemSelected(AdapterView<?> parent, View view, int position, long
return;
}


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){
boolean enable = position > 0;
/*
The AI noise suppression modes:
0: (Default) Balance mode. This mode allows for a balanced performance on noice suppression and time delay.
1: Aggressive mode. In scenarios where high performance on noise suppression is required, such as live streaming
outdoor events, this mode reduces nosies more dramatically, but sometimes may affect the original character of the audio.
2: Aggressive mode with low latency. The noise suppression delay of this mode is about only half of that of the balance
and aggressive modes. It is suitable for scenarios that have high requirements on noise suppression with low latency,
such as sing together online in real time.
*/
engine.setAINSMode(enable, position - 1);
}
}

private int getVoiceConversionValue(String label) {
Expand Down
Loading