mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-07 14:57:12 -04:00
mic-tester: fix types
This commit is contained in:
parent
17a885f097
commit
05c51e5f60
1 changed files with 6 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue