Skip to content

Commit

Permalink
Use speech as default audio publish rate. Allow overriding defaults i…
Browse files Browse the repository at this point in the history
…n `connect`, without dropping other defaults entirely.
  • Loading branch information
davidzhao committed Oct 29, 2021
1 parent 95db324 commit d038c52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/connect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import log from './logger';
import { WSSignalClient } from './api/SignalClient';
import log from './logger';
import {
ConnectOptions,
LogLevel,
Expand Down Expand Up @@ -57,10 +57,10 @@ export async function connect(

// save default publish options
if (options.publishDefaults) {
room.defaultPublishOptions = options.publishDefaults;
Object.assign(room.defaultPublishOptions, options.publishDefaults);
}
if (options.captureDefaults) {
room.defaultCaptureOptions = options.captureDefaults;
Object.assign(room.defaultCaptureOptions, options.captureDefaults);
}

const publishAudio: boolean = options.audio;
Expand Down
8 changes: 6 additions & 2 deletions src/room/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { TrackCaptureDefaults, TrackPublishDefaults, VideoPresets } from './track/options';
import {
AudioPresets, TrackCaptureDefaults, TrackPublishDefaults, VideoPresets,
} from './track/options';

let publishDefaults: TrackPublishDefaults = {};
let publishDefaults: TrackPublishDefaults = {
audioBitrate: AudioPresets.speech.maxBitrate,
};

let captureDefaults: TrackCaptureDefaults = {
autoGainControl: true,
Expand Down

0 comments on commit d038c52

Please sign in to comment.