Skip to content

Commit

Permalink
fix: refactor, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed Nov 22, 2024
1 parent 3bfded4 commit bbc61d7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { standardMediaConstraints } from './constants';
import { IAnalyticsPropertiesProvider } from '../../analytics/IAnalyticsPropertiesProvider';
import { HMSAudioCodec, HMSAudioMode, HMSAudioTrackSettings as IHMSAudioTrackSettings } from '../../interfaces';

Expand All @@ -8,20 +9,11 @@ export class HMSAudioTrackSettingsBuilder {
private _deviceId = 'default';
private _audioMode: HMSAudioMode = HMSAudioMode.VOICE;
private _advanced: Array<MediaTrackConstraintSet> = [
// @ts-ignore
{ googEchoCancellation: { exact: true } },
// @ts-ignore
{ googExperimentalEchoCancellation: { exact: true } },
// @ts-ignore
...standardMediaConstraints,
{ autoGainControl: { exact: true } },
// @ts-ignore
{ noiseSuppression: { exact: true } },
// @ts-ignore
{ googHighpassFilter: { exact: true } },
// @ts-ignore
{ googAudioMirroring: { exact: true } },
];

volume(volume: number) {
if (!(0.0 <= volume && volume <= 1.0)) {
throw Error('volume can only be in range [0.0, 1.0]');
Expand Down
8 changes: 8 additions & 0 deletions packages/hms-video-store/src/media/settings/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const standardMediaConstraints = [
{ echoCancellation: { exact: true } },
{ highpassFilter: { exact: true } },
{ audioMirroring: { exact: true } },
// These options can vary depending on the audio plugin
// { autoGainControl: { exact: true } },
// { noiseSuppression: { exact: true } },
];
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ErrorFactory } from '../../error/ErrorFactory';
import { HMSAction } from '../../error/HMSAction';
import { EventBus } from '../../events/EventBus';
import { HMSAudioTrackSettingsBuilder } from '../../media/settings';
import { standardMediaConstraints } from '../../media/settings/constants';
import { HMSLocalAudioTrack } from '../../media/tracks';
import Room from '../../sdk/models/HMSRoom';
import HMSLogger from '../../utils/logger';
Expand Down Expand Up @@ -92,18 +93,11 @@ export class HMSAudioPluginsManager {
.maxBitrate(settings.maxBitrate)
.deviceId(settings.deviceId!)
.advanced([
// @ts-ignore
{ googEchoCancellation: { exact: true } },
// @ts-ignore
{ googExperimentalEchoCancellation: { exact: true } },
...standardMediaConstraints,
// @ts-ignore
{ autoGainControl: { exact: false } },
// @ts-ignore
{ noiseSuppression: { exact: false } },
// @ts-ignore
{ googHighpassFilter: { exact: true } },
// @ts-ignore
{ googAudioMirroring: { exact: true } },
])
.audioMode(settings.audioMode)
.build();
Expand Down Expand Up @@ -194,18 +188,11 @@ export class HMSAudioPluginsManager {
.maxBitrate(settings.maxBitrate)
.deviceId(settings.deviceId!)
.advanced([
// @ts-ignore
{ googEchoCancellation: { exact: true } },
// @ts-ignore
{ googExperimentalEchoCancellation: { exact: true } },
...standardMediaConstraints,
// @ts-ignore
{ autoGainControl: { exact: true } },
// @ts-ignore
{ noiseSuppression: { exact: true } },
// @ts-ignore
{ googHighpassFilter: { exact: true } },
// @ts-ignore
{ googAudioMirroring: { exact: true } },
])
.audioMode(settings.audioMode)
.build();
Expand Down
2 changes: 1 addition & 1 deletion packages/roomkit-react/package.json

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

8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@100mslive/[email protected].6":
version "0.0.2-alpha.6"
resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.2-alpha.6.tgz#f8f4c00f82dbdc3366b8e2487bcb75aeb2bca60c"
integrity sha512-hQDMXaK7zMK0P2xfXgorth9gvMyr0K3vEVVQit/iHajCzIhnZbkKLgfySW8nQz2z5cePnI0X3ZUN/HP7UTdA/Q==
"@100mslive/[email protected].7":
version "0.0.2-alpha.7"
resolved "https://registry.yarnpkg.com/@100mslive/hms-noise-cancellation/-/hms-noise-cancellation-0.0.2-alpha.7.tgz#049221bf8cac991c2e29594cf92e4022d1a8190b"
integrity sha512-XRhhbGWDWnSnKK6cfSiVaBpRyTleG/ysZr36Vec3WJab26rLBP7B9JTn0kT8MYpbBW+1mmyuPjR7vwI20Qo/vQ==

"@100mslive/[email protected]":
version "0.12.12"
Expand Down

0 comments on commit bbc61d7

Please sign in to comment.