File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { onBeforeUnmount , ref } from 'vue' ;
2
2
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 ) {
5
8
let audioContext : AudioContext | null = null ;
6
9
let delayNode : DelayNode | null = null ;
7
10
let sourceNode : MediaStreamAudioSourceNode | null = null ;
@@ -35,7 +38,7 @@ export function useMicrophoneService(messageSender) {
35
38
36
39
const startMicReplay = async ( ) => {
37
40
if ( ! audioContext ) {
38
- audioContext = new ( window . AudioContext || window . webkitAudioContext ) ( ) ;
41
+ audioContext = new ( window . AudioContext || ( window as any ) . webkitAudioContext ) ( ) ;
39
42
}
40
43
41
44
try {
You can’t perform that action at this time.
0 commit comments