Skip to content

Commit 187a6e6

Browse files
Revert "fix:voice的setInterval失效"
This reverts commit 09bce70.
1 parent ab1e0a6 commit 187a6e6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pages/API/voice/voice.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@
9898
console.log('recorder start');
9999
100100
this.recording = true;
101+
recordTimeInterval = setInterval(() => {
102+
this.recordTime += 1;
103+
this.formatedRecordTime = util.formatTime(this.recordTime);
104+
}, 1000)
101105
});
102106
recorderManager.onStop((res) => {
103107
console.log('on stop');
@@ -118,11 +122,6 @@
118122
return;
119123
}
120124
// #endif
121-
122-
recordTimeInterval = setInterval(() => {
123-
this.recordTime += 1;
124-
this.formatedRecordTime = util.formatTime(this.recordTime);
125-
}, 1000)
126125
127126
// TODO ios 在没有请求过权限之前无法得知是否有相关权限,这种状态下需要直接调用录音,但没有状态或回调判断用户拒绝
128127
recorderManager.start({
@@ -135,11 +134,11 @@
135134
},
136135
playVoice() {
137136
console.log('play voice');
137+
this.playing = true;
138138
playTimeInterval = setInterval(() => {
139139
this.playTime += 1;
140140
this.formatedPlayTime = util.formatTime(this.playTime);
141141
}, 1000)
142-
this.playing = true;
143142
music.play();
144143
},
145144
stopVoice() {

0 commit comments

Comments
 (0)