苹果机修复ios无法开启录音的bug

This commit is contained in:
2025-12-08 20:12:07 +08:00
parent 684a0d264e
commit 6e6274d27a
167 changed files with 447 additions and 63 deletions
@@ -133,18 +133,10 @@
URL.revokeObjectURL(blobUrl);
const mediaStream = new MediaStream();
} else if (os === 'iOS') {
console.log('是iOS');
audioContext = new AudioContext();
// 加载并初始化AudioWorklet
await audioContext.audioWorklet.addModule('static/dist/processor.worklet.js');
await audioContext.audioWorklet.addModule('static/js/processor.worklet.js');
}
mediaStream = await navigator.mediaDevices.getUserMedia({
audio: {
sampleRate: options.sampleRate,
+10 -3
View File
@@ -124,9 +124,10 @@
import { ref, unref, onMounted, computed, nextTick } from 'vue';
import { onShow, onLoad, onUnload, onLaunch, onBackPress } from '@dcloudio/uni-app';
import common from '@/common/common';
import {getPhoneEnvBool} from '@/common/common';
import TouchBtn from './components/touchBtn.vue';
import ImagePreview from '@/components/image-preview/image-preview.vue';
import { commonUploadVoiceFile } from '@/api/common.js';
import { commonUploadVoiceFile} from '@/api/common.js';
import { queryTraPartnerCharacterInfoById, partnerChatReportTrigger } from '@/api/sparring.js';
import { useSocketStore } from '@/store/socket.js';
import { useStorageStore } from '@/store/storage.js';
@@ -240,9 +241,15 @@
};
const toTalking = async () => {
try {
await initRecord();
console.log('权限状态');
console.log('申请权限',getPhoneEnvBool('AND'));
if(getPhoneEnvBool('AND')){
console.log('申请权限');
// await initRecord();
}
common.setPageCache('tipMsgsceneDesc', {
sceneDesc: detailInfo.value.sceneDesc
});