TIANYONG 1 год назад
Родитель
Сommit
c84999951f
2 измененных файлов с 16 добавлено и 3 удалено
  1. 13 2
      src/helpers/communication.ts
  2. 3 1
      src/view/evaluating/index.tsx

+ 13 - 2
src/helpers/communication.ts

@@ -65,9 +65,9 @@ export const cancelEvaluating = () => {
 };
 
 /** 评测开始录音 */
-export const api_startRecording = (): Promise<IPostMessage | undefined> => {
+export const api_startRecording = (content: any): Promise<IPostMessage | undefined> => {
 	if (!storeData.isApp) return Promise.resolve({} as any);
-	return promisefiyPostMessage({ api: "startRecording" });
+	return promisefiyPostMessage({ api: "startRecording", content: content });
 };
 /** 评测结束录音 */
 export const api_stopRecording = (): Promise<IPostMessage | undefined> => {
@@ -310,4 +310,15 @@ export const hideComplexButton = (callback: CallBack, listen?: boolean) => {
 	} else {
 		removeListenerMessage("hideComplexButton", callback);
 	}
+};
+
+
+/** 评测模式是否开启/关闭伴奏 */
+export const api_onoffAccompaniment = () => {
+	postMessage({
+		api: "onoffAccompaniment",
+		content: {
+			state: 0,
+		},
+	});
 };

+ 3 - 1
src/view/evaluating/index.tsx

@@ -282,7 +282,9 @@ export const handleStartBegin = async () => {
 		onPlay();
 	}
 	//开始录音
-	await api_startRecording();
+	await api_startRecording({
+		accompanimentState: state.setting.enableAccompaniment ? 1 : 0
+	});
 
 	// 如果开启了摄像头, 开启录制视频
 	if (state.setting.camera) {