Fixes audio recording

This commit is contained in:
Josh Perez 2023-01-26 11:57:39 -05:00 committed by GitHub
parent 10b0ec12a1
commit 28a295d4e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 7 deletions

View file

@ -157,5 +157,3 @@ export class WebAudioRecorder {
this.onError(this, `WebAudioRecorder.js: ${message}`);
}
}
window.WebAudioRecorder = WebAudioRecorder;

View file

@ -1,10 +1,10 @@
// Copyright 2016 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions';
import * as log from '../logging/log';
import type { WebAudioRecorder } from '../WebAudioRecorder';
import * as Errors from '../types/errors';
import { requestMicrophonePermissions } from '../util/requestMicrophonePermissions';
import { WebAudioRecorder } from '../WebAudioRecorder';
export class RecorderClass {
private context?: AudioContext;
@ -58,7 +58,7 @@ export class RecorderClass {
this.context = new AudioContext();
this.input = this.context.createGain();
this.recorder = new window.WebAudioRecorder(
this.recorder = new WebAudioRecorder(
this.input,
{
timeLimit: 60 + 3600, // one minute more than our UI-imposed limit

View file

@ -116,6 +116,7 @@ function startRecording(
});
}
} catch (err) {
log.error('AudioRecorder/ERROR_RECORDING', err);
dispatch({
type: ERROR_RECORDING,
payload: ErrorDialogAudioRecorderType.ErrorRecording,

2
ts/window.d.ts vendored
View file

@ -55,7 +55,6 @@ import type { IPCEventsType } from './util/createIPCEvents';
import type { SignalContextType } from './windows/context';
import type * as Message2 from './types/Message2';
import type { initializeMigrations } from './signal';
import type { WebAudioRecorder } from './WebAudioRecorder';
export { Long } from 'long';
@ -205,7 +204,6 @@ declare global {
MessageController: MessageController;
SignalProtocolStore: typeof SignalProtocolStore;
WebAPI: WebAPIConnectType;
WebAudioRecorder: typeof WebAudioRecorder;
Whisper: WhisperType;
getSignalProtocolStore: () => SignalProtocolStore;
i18n: LocalizerType;