This commit is contained in:
田岩
2025-12-01 21:00:54 +08:00
parent fde86ef902
commit 67c44bc746
97 changed files with 45781 additions and 395 deletions
@@ -121,7 +121,7 @@ if (uni.restoreGlobal) {
}
if (typeof block0$1 === "function")
block0$1(_sfc_main$3);
const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "F:/aistream-test/测试流式传输uniapp/uni_modules/yao-RecordFrame/components/yao-RecordFrame/yao-RecordFrame.vue"]]);
const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "C:/Users/1/Desktop/testAudio/测试流式传输uniapp/uni_modules/yao-RecordFrame/components/yao-RecordFrame/yao-RecordFrame.vue"]]);
const block0 = (Comp) => {
(Comp.$renderjs || (Comp.$renderjs = [])).push("renderJS");
(Comp.$renderjsModules || (Comp.$renderjsModules = {}))["renderJS"] = "5f91482f";
@@ -137,14 +137,14 @@ if (uni.restoreGlobal) {
methods: {
connect() {
this.ws = uni.connectSocket({
url: "ws://10.10.10.201:8000/ws/audio",
url: "ws://172.16.89.58:8000/ws/audio",
complete: () => {
formatAppLog("log", "at uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue:41", "complete");
formatAppLog("log", "at uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue:27", "complete");
},
success: () => {
formatAppLog("log", "at uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue:44", "web");
formatAppLog("log", "at uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue:30", "web");
this.ws.onOpen((res) => {
formatAppLog("log", "at uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue:46", "WebSocket连接已打开", res);
formatAppLog("log", "at uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue:32", "WebSocket连接已打开", res);
this.ws.onMessage((res2) => {
let messageData = res2.data;
if (typeof messageData === "string") {
@@ -168,6 +168,10 @@ if (uni.restoreGlobal) {
},
changeStreamPlaying(e) {
this.isStreamPlaying = e.type;
},
appendBuffer(messageData) {
this.isStreamPlaying = true;
this.currBuffer = uni.arrayBufferToBase64(messageData);
}
}
};
@@ -200,7 +204,7 @@ if (uni.restoreGlobal) {
}
if (typeof block0 === "function")
block0(_sfc_main$2);
const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "F:/aistream-test/测试流式传输uniapp/uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue"]]);
const __easycom_1 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__file", "C:/Users/1/Desktop/testAudio/测试流式传输uniapp/uni_modules/sdx-StreamPlayer/components/sdx-StreamPlayer/sdx-StreamPlayer.vue"]]);
const _sfc_main$1 = {
data() {
return {
@@ -217,7 +221,7 @@ if (uni.restoreGlobal) {
// 音频源节点
frameBufferList: [],
// 缓存音频帧
wsUrl: "ws://10.10.10.201:8000/ws/audio"
wsUrl: "ws://172.16.89.58:8000/ws/audio"
// 替换为实际后端地址
};
},
@@ -275,12 +279,18 @@ if (uni.restoreGlobal) {
} catch (e) {
this.handleMessage(messageData);
}
} else if (messageData instanceof ArrayBuffer) {
try {
this.$refs.aaa.appendBuffer(messageData);
} catch (e) {
formatAppLog("log", "at pages/index/index.vue:104", "二进制数据解析失败:", e);
}
}
});
});
},
fail: () => {
formatAppLog("log", "at pages/index/index.vue:109", "fail");
formatAppLog("log", "at pages/index/index.vue:111", "fail");
}
});
try {
@@ -303,7 +313,7 @@ if (uni.restoreGlobal) {
this.isRecording = true;
this.status = "录音中...";
} catch (e) {
formatAppLog("error", "at pages/index/index.vue:140", "启动录音失败:", e);
formatAppLog("error", "at pages/index/index.vue:142", "启动录音失败:", e);
this.status = "启动录音失败";
this.isRecording = false;
}
@@ -342,7 +352,7 @@ if (uni.restoreGlobal) {
data: frameBuffer
});
} catch (e) {
formatAppLog("error", "at pages/index/index.vue:192", "发送音频帧失败:", e);
formatAppLog("error", "at pages/index/index.vue:194", "发送音频帧失败:", e);
}
}
},
@@ -352,7 +362,7 @@ if (uni.restoreGlobal) {
// 录音停止回调
stopIt(base64) {
this.stopRecordAndClean();
formatAppLog("log", "at pages/index/index.vue:208", "录音停止,最终音频Base64", (base64 == null ? void 0 : base64.substring(0, 50)) + "...");
formatAppLog("log", "at pages/index/index.vue:210", "录音停止,最终音频Base64", (base64 == null ? void 0 : base64.substring(0, 50)) + "...");
}
}
};
@@ -388,16 +398,22 @@ if (uni.restoreGlobal) {
onCurrentDecibels: $options.onCurrentDecibels,
onOnStop: $options.stopIt
}, null, 8, ["onOnFrameRecorded", "onCurrentDecibels", "onOnStop"]),
vue.createVNode(_component_sdx_StreamPlayer, null, {
default: vue.withCtx(() => [
vue.createTextVNode("xx")
]),
_: 1
/* STABLE */
})
vue.createVNode(
_component_sdx_StreamPlayer,
{ ref: "aaa" },
{
default: vue.withCtx(() => [
vue.createTextVNode("xx")
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
]);
}
const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-1cf27b2a"], ["__file", "F:/aistream-test/测试流式传输uniapp/pages/index/index.vue"]]);
const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-1cf27b2a"], ["__file", "C:/Users/1/Desktop/testAudio/测试流式传输uniapp/pages/index/index.vue"]]);
__definePage("pages/index/index", PagesIndexIndex);
const _sfc_main = {
onLaunch: function() {
@@ -410,7 +426,7 @@ if (uni.restoreGlobal) {
formatAppLog("log", "at App.vue:10", "App Hide");
}
};
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "F:/aistream-test/测试流式传输uniapp/App.vue"]]);
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "C:/Users/1/Desktop/testAudio/测试流式传输uniapp/App.vue"]]);
function createApp() {
const app = vue.createVueApp(App);
return {