mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-27 07:58:54 +03:00
mic-tester: fix types
This commit is contained in:
1 parent
17a885f097
commit
05c51e5f60
1 file changed
+6
-3
@@ -1,7 +1,10 @@
|
|||||||
import { onBeforeUnmount, ref } from 'vue';
|
import { onBeforeUnmount, ref } from 'vue';
|
||||||
|
|
||||||
// messageSender has to support error(text) method for notifying the user of errors
|
interface IMessageSender {
|
||||||
export function useMicrophoneService(messageSender) {
|
error: (...messages: any[]) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useMicrophoneService(messageSender: IMessageSender) {
|
||||||
let audioContext: AudioContext | null = null;
|
let audioContext: AudioContext | null = null;
|
||||||
let delayNode: DelayNode | null = null;
|
let delayNode: DelayNode | null = null;
|
||||||
let sourceNode: MediaStreamAudioSourceNode | null = null;
|
let sourceNode: MediaStreamAudioSourceNode | null = null;
|
||||||
@@ -35,7 +38,7 @@ export function useMicrophoneService(messageSender) {
|
|||||||
|
|
||||||
const startMicReplay = async () => {
|
const startMicReplay = async () => {
|
||||||
if (!audioContext) {
|
if (!audioContext) {
|
||||||
audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
audioContext = new (window.AudioContext || (window as any).webkitAudioContext)();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user