Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Install pnpm 🤏🏻
uses: pnpm/action-setup@v4
with:
version: latest
version: 9

- name: Setup Node 💚
uses: actions/setup-node@v3
Expand Down
4 changes: 2 additions & 2 deletions packages/fake/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc-fake",
"version": "0.9.1-rc.4",
"version": "0.9.1-rc.6",
"description": "wait",
"main": "./index.ts",
"scripts": {
Expand All @@ -13,7 +13,7 @@
"license": "MIT",
"dependencies": {
"@iris/native-rtc": "workspace: *",
"agora-rtc-sdk-ng": "4.23.2",
"agora-rtc-sdk-ng": "4.24.2",
"@agoraio-extensions/agora-rtc-sdk-ng-fake": "^1.0.16",
"iris-web-rtc": "workspace: *"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/rtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iris-web-rtc",
"version": "0.9.1-rc.4",
"version": "0.9.1-rc.6",
"description": "wait",
"main": "./src/index.ts",
"scripts": {
Expand All @@ -19,7 +19,7 @@
"dependencies": {
"@agoraio-extensions/agora-rtc-sdk-ng-fake": "^1.0.16",
"@iris/native-rtc": "workspace: *",
"agora-rtc-sdk-ng": "4.23.2",
"agora-rtc-sdk-ng": "4.24.2",
"iris-web-core": "workspace: *"
},
"files": [
Expand Down
7 changes: 6 additions & 1 deletion packages/rtc/src/engine/IrisClientManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@
this.localAudioTrackPackages.push(audioTrackPackage);
this.irisClientObserver.addAudioTrackPackageObserver(audioTrackPackage);
let track = audioTrackPackage.track as ILocalAudioTrack;
if (this._engine.globalState.enableAINS) {
//only enable AINS for microphone primary
if (
this._engine.globalState.enableAINS &&
audioTrackPackage.type ===
IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary

Check warning on line 243 in packages/rtc/src/engine/IrisClientManager.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
) {
let AINSprocessor = this._engine.globalState.AIDenoiser.createProcessor();
track.pipe(AINSprocessor).pipe(track.processorDestination);
audioTrackPackage.AINSprocessor = AINSprocessor;
Expand Down
28 changes: 21 additions & 7 deletions packages/rtc/src/helper/ImplHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import { IrisRtcEngine } from '../engine/IrisRtcEngine';
import { IrisTrackEventHandler } from '../event_handler/IrisTrackEventHandler';
import { IRtcEngineExImpl } from '../impl/IAgoraRtcEngineExImpl';
import { IRtcEngineImpl } from '../impl/IAgoraRtcEngineImpl';

import { IrisGlobalState } from '../state/IrisGlobalState';
Expand Down Expand Up @@ -244,7 +245,11 @@
);
}
} catch (e) {
AgoraConsole.error('createMicrophoneAudioTrack failed');
this._engine.rtcEngineEventHandler.onError(
NATIVE_RTC.ERROR_CODE_TYPE.ERR_NO_PERMISSION,
''
);

Check warning on line 251 in packages/rtc/src/helper/ImplHelper.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
AgoraConsole.warn('createMicrophoneAudioTrack failed');

Check warning on line 252 in packages/rtc/src/helper/ImplHelper.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
throw e;
}

Expand Down Expand Up @@ -465,12 +470,21 @@
NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_AUDIENCE &&
irisClientState.clientRoleType !== options.clientRoleType
) {
(this._engine.getImplInstance(
'RtcEngine'
) as IRtcEngineImpl).muteLocalAudioStream(true);
(this._engine.getImplInstance(
'RtcEngine'
) as IRtcEngineImpl).muteLocalVideoStream(true);
if (connection) {
(this._engine.getImplInstance(
'RtcEngineEx'
) as IRtcEngineExImpl).muteLocalAudioStreamEx(true, connection);
(this._engine.getImplInstance(
'RtcEngineEx'
) as IRtcEngineExImpl).muteLocalVideoStreamEx(true, connection);
} else {
(this._engine.getImplInstance(
'RtcEngine'
) as IRtcEngineImpl).muteLocalAudioStream(true);
(this._engine.getImplInstance(
'RtcEngine'
) as IRtcEngineImpl).muteLocalVideoStream(true);
}
this._engine.rtcEngineEventHandler.onClientRoleChangedEx(
irisClient.connection!,
irisClientState.clientRoleType!,
Expand Down
6 changes: 1 addition & 5 deletions packages/rtc/src/helper/TrackHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ export class TrackHelper {
try {
await track?.setPlaybackDevice(deviceId);
} catch (e) {
AgoraConsole.error(e);
Promise.resolve(
new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e)
);
throw e;
//
}
}

Expand Down
36 changes: 21 additions & 15 deletions packages/rtc/src/impl/IAgoraRtcEngineImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -964,41 +964,47 @@
enabled: boolean,
mode: NATIVE_RTC.AUDIO_AINS_MODE
): CallApiReturnType {
let processFunc = async (): Promise<CallIrisApiResult> => {
if (enabled) {
if (!this._engine.globalState.AIDenoiser) {
AgoraConsole.error(
'AIDenoiser not found, please set it first by use engine.setParameters'
);
return this._engine.returnResult(false);
}
}

for (
let i = 0;
i < this._engine.irisClientManager.localAudioTrackPackages.length;
i++
) {
let audioTrackPackage = this._engine.irisClientManager
.localAudioTrackPackages[i];
let audioTrack = audioTrackPackage.track as ILocalAudioTrack;

if (enabled) {
if (!audioTrackPackage.AINSprocessor) {
let AINSprocessor = this._engine.globalState.AIDenoiser.createProcessor();
audioTrack
.pipe(AINSprocessor)
.pipe(audioTrack.processorDestination);
audioTrackPackage.AINSprocessor = AINSprocessor;
await AINSprocessor.enable();
} else {
await audioTrackPackage.AINSprocessor.enable();
}
} else {
if (audioTrackPackage.AINSprocessor) {
await audioTrackPackage.AINSprocessor.disable();
//only enable AINS for microphone primary
if (
audioTrackPackage.type ===
IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary
) {
if (enabled) {
if (!audioTrackPackage.AINSprocessor) {
let AINSprocessor = this._engine.globalState.AIDenoiser.createProcessor();

Check warning on line 993 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
audioTrack
.pipe(AINSprocessor)
.pipe(audioTrack.processorDestination);

Check warning on line 996 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
audioTrackPackage.AINSprocessor = AINSprocessor;

Check warning on line 997 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
await AINSprocessor.enable();

Check warning on line 998 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
} else {
await audioTrackPackage.AINSprocessor.enable();

Check warning on line 1000 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 1001 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 1001 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 1001 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
} else {
//do nothing
if (audioTrackPackage.AINSprocessor) {
await audioTrackPackage.AINSprocessor.disable();

Check warning on line 1004 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
} else {
//do nothing
}

Check warning on line 1007 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 1007 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 1007 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 1008 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 1008 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

Check warning on line 1008 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 1009 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 1009 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
}

Check warning on line 1010 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
Expand Down Expand Up @@ -1055,7 +1061,7 @@
this._engine.globalState.enableAGC = json[keyList[i]];

for (
let i = 0;

Check warning on line 1064 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / build

'i' is already declared in the upper scope on line 1051 column 18

Check warning on line 1064 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Test PR

'i' is already declared in the upper scope on line 1051 column 18
i < this._engine.irisClientManager.irisClientList.length;
i++
) {
Expand All @@ -1071,7 +1077,7 @@
case 'che.audio.aec.enable':
this._engine.globalState.enableAEC = json[keyList[i]];
for (
let i = 0;

Check warning on line 1080 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / build

'i' is already declared in the upper scope on line 1051 column 18

Check warning on line 1080 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Test PR

'i' is already declared in the upper scope on line 1051 column 18
i < this._engine.irisClientManager.irisClientList.length;
i++
) {
Expand All @@ -1086,7 +1092,7 @@
case 'che.audio.ans.enable':
this._engine.globalState.enableANS = json[keyList[i]];
for (
let i = 0;

Check warning on line 1095 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / build

'i' is already declared in the upper scope on line 1051 column 18

Check warning on line 1095 in packages/rtc/src/impl/IAgoraRtcEngineImpl.ts

View workflow job for this annotation

GitHub Actions / Test PR

'i' is already declared in the upper scope on line 1051 column 18
i < this._engine.irisClientManager.irisClientList.length;
i++
) {
Expand Down
76 changes: 44 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading