mic-tester: fix types

This commit is contained in:
gornvan 2024-10-09 22:52:25 +02:00
parent 17a885f097
commit 05c51e5f60

View file

@ -1,7 +1,10 @@
import { onBeforeUnmount, ref } from 'vue';
// messageSender has to support error(text) method for notifying the user of errors
export function useMicrophoneService(messageSender) {
interface IMessageSender {
error: (...messages: any[]) => void
}
export function useMicrophoneService(messageSender: IMessageSender) {
let audioContext: AudioContext | null = null;
let delayNode: DelayNode | null = null;
let sourceNode: MediaStreamAudioSourceNode | null = null;
@ -35,7 +38,7 @@ export function useMicrophoneService(messageSender) {
const startMicReplay = async () => {
if (!audioContext) {
audioContext = new (window.AudioContext || window.webkitAudioContext)();
audioContext = new (window.AudioContext || (window as any).webkitAudioContext)();
}
try {