|
@@ -23,8 +23,8 @@ import {
|
|
|
import {
|
|
|
setDuration
|
|
|
} from '~/utils/util'
|
|
|
-const aiengine = require('~/utils/ChivoxAiEngine')
|
|
|
-const sha1 = require('~/utils/sha1');
|
|
|
+let aiengine = require('~/utils/ChivoxAiEngine')
|
|
|
+let sha1 = require('~/utils/sha1');
|
|
|
|
|
|
let rowH = 0
|
|
|
let videoContext = null
|
|
@@ -72,7 +72,8 @@ Page({
|
|
|
activityId: '',
|
|
|
|
|
|
free: 1,
|
|
|
- isVip: false
|
|
|
+ isVip: false,
|
|
|
+ tempFilePath: ""
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
console.log(options);
|
|
@@ -302,7 +303,7 @@ Page({
|
|
|
attachAudioUrl: 1,
|
|
|
result: {
|
|
|
details: {
|
|
|
- gop_adjust: -0.1
|
|
|
+ gop_adjust: 0.5
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -315,7 +316,7 @@ Page({
|
|
|
},
|
|
|
success: (res) => {
|
|
|
|
|
|
- const options = {
|
|
|
+ let options = {
|
|
|
duration: 600000,
|
|
|
sampleRate: 44100,
|
|
|
numberOfChannels: 1,
|
|
@@ -353,7 +354,7 @@ Page({
|
|
|
});
|
|
|
|
|
|
recorderManager.onFrameRecorded((res) => {
|
|
|
- const {
|
|
|
+ let {
|
|
|
frameBuffer
|
|
|
} = res
|
|
|
|
|
@@ -386,12 +387,19 @@ Page({
|
|
|
|
|
|
|
|
|
async getRecordScore(res) {
|
|
|
- const result = res.result;
|
|
|
- const integrity = Math.floor(result.integrity);
|
|
|
- const tone = Math.floor(result.tone);
|
|
|
- const accuracy = Math.floor(result.accuracy);
|
|
|
- const fluency = Math.floor(result.fluency.overall);
|
|
|
- let myOverall = Math.floor(integrity * 0.45 + accuracy * 0.35 + fluency * 0.1 + tone * 0.1);
|
|
|
+ let result = res.result;
|
|
|
+ let businessType = this.data.videoInfo.userReadExtend.businessType
|
|
|
+ let integrity = Math.floor(result.integrity);
|
|
|
+ let accuracy = Math.floor(result.accuracy);
|
|
|
+ let fluency = Math.floor(result.fluency.overall);
|
|
|
+ let tone = 0
|
|
|
+ let myOverall = 0;
|
|
|
+ if (businessType == 0) {
|
|
|
+ tone = Math.floor(result.tone);
|
|
|
+ myOverall = Math.floor(integrity * 0.45 + accuracy * 0.35 + fluency * 0.1 + tone * 0.1);
|
|
|
+ } else if (businessType == 1) {
|
|
|
+ myOverall = Math.floor(integrity * 0.45 + accuracy * 0.45 + fluency * 0.1);
|
|
|
+ }
|
|
|
let detail = {
|
|
|
integrity,
|
|
|
tone,
|
|
@@ -406,7 +414,7 @@ Page({
|
|
|
aBg: this.data.videoInfo.userReadExtend.resourcesType == 1 ? this.data.videoInfo.userReadExtend.backgroundVirtualImg : '',
|
|
|
originVideo: this.data.videoInfo.userRead.originVideo
|
|
|
}
|
|
|
- console.log('评测结果', detail);
|
|
|
+ console.log('评测结果2', detail);
|
|
|
this.setReadDetail(detail)
|
|
|
await userEvent({
|
|
|
action: 'WXSCORE',
|
|
@@ -434,7 +442,7 @@ Page({
|
|
|
this.setData({
|
|
|
uploadState: true
|
|
|
})
|
|
|
- const uploadTask = wx.uploadFile({
|
|
|
+ let uploadTask = wx.uploadFile({
|
|
|
url: 'https://reader-api.ai160.com//file/upload',
|
|
|
filePath: this.data.tempFilePath,
|
|
|
name: '朗读录音',
|
|
@@ -442,7 +450,7 @@ Page({
|
|
|
uid: wx.getStorageSync('uid')
|
|
|
},
|
|
|
success: async (res) => {
|
|
|
- const formateRes = JSON.parse(res.data);
|
|
|
+ let formateRes = JSON.parse(res.data);
|
|
|
let audioPath = formateRes.data;
|
|
|
let uploadRes = await publishWorks({
|
|
|
exampleId: this.data.pkData.exampleId,
|
|
@@ -721,9 +729,9 @@ Page({
|
|
|
node: true,
|
|
|
size: true
|
|
|
}).exec((res) => {
|
|
|
- const canvas = res[0].node;
|
|
|
- const ctx = canvas.getContext('2d');
|
|
|
- const dpr = wx.getSystemInfoSync().pixelRatio;
|
|
|
+ let canvas = res[0].node;
|
|
|
+ let ctx = canvas.getContext('2d');
|
|
|
+ let dpr = wx.getSystemInfoSync().pixelRatio;
|
|
|
canvas.width = res[0].width * dpr;
|
|
|
canvas.height = res[0].height * dpr;
|
|
|
ctx.scale(dpr, dpr);
|
|
@@ -816,7 +824,7 @@ Page({
|
|
|
target
|
|
|
}) {
|
|
|
if (from == 'button') {
|
|
|
- const promise = new Promise(resolve => {
|
|
|
+ let promise = new Promise(resolve => {
|
|
|
this.creatShare().then(res => {
|
|
|
resolve(res)
|
|
|
})
|