Skip to content

Commit 05c51e5

Browse files
committed
mic-tester: fix types
1 parent 17a885f commit 05c51e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tools/mic-tester/mic-tester.service.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { onBeforeUnmount, ref } from 'vue';
22

3-
// messageSender has to support error(text) method for notifying the user of errors
4-
export function useMicrophoneService(messageSender) {
3+
interface IMessageSender {
4+
error: (...messages: any[]) => void
5+
}
6+
7+
export function useMicrophoneService(messageSender: IMessageSender) {
58
let audioContext: AudioContext | null = null;
69
let delayNode: DelayNode | null = null;
710
let sourceNode: MediaStreamAudioSourceNode | null = null;
@@ -35,7 +38,7 @@ export function useMicrophoneService(messageSender) {
3538

3639
const startMicReplay = async () => {
3740
if (!audioContext) {
38-
audioContext = new (window.AudioContext || window.webkitAudioContext)();
41+
audioContext = new (window.AudioContext || (window as any).webkitAudioContext)();
3942
}
4043

4144
try {

0 commit comments

Comments
 (0)