|
@@ -40,6 +40,14 @@ let resultAudioContext = null
|
|
let wsEngine = aiengine.createWsEngine({});
|
|
let wsEngine = aiengine.createWsEngine({});
|
|
/*微信录音*/
|
|
/*微信录音*/
|
|
let recorderManager = wx.getRecorderManager();
|
|
let recorderManager = wx.getRecorderManager();
|
|
|
|
+let options = {
|
|
|
|
+ duration: 600000,
|
|
|
|
+ sampleRate: 44100, //采样率
|
|
|
|
+ numberOfChannels: 1, //录音通道数
|
|
|
|
+ encodeBitRate: 192000, //编码码率
|
|
|
|
+ format: 'mp3', //音频格式,有效值aac/mp3
|
|
|
|
+ frameSize: 50 //指定帧大小,单位 KB
|
|
|
|
+};
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
videoInfo: {},
|
|
videoInfo: {},
|
|
@@ -90,12 +98,12 @@ Page({
|
|
})
|
|
})
|
|
this.getreadInfo(videoId, options.reset).then(res => {
|
|
this.getreadInfo(videoId, options.reset).then(res => {
|
|
wx.nextTick(() => {
|
|
wx.nextTick(() => {
|
|
- if (options.voluntarily && this.data.isVip) {
|
|
|
|
- this.setCountDown()
|
|
|
|
- }
|
|
|
|
- if (options.autoPlay) {
|
|
|
|
- this.videoPlay()
|
|
|
|
- }
|
|
|
|
|
|
+ /* if (options.voluntarily && this.data.isVip) {
|
|
|
|
+ this.setCountDown()
|
|
|
|
+ }
|
|
|
|
+ if (options.autoPlay) {
|
|
|
|
+ this.videoPlay()
|
|
|
|
+ } */
|
|
})
|
|
})
|
|
})
|
|
})
|
|
// 手工绑定
|
|
// 手工绑定
|
|
@@ -319,16 +327,8 @@ Page({
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
/*引擎启动成功,可以启动录音机开始录音,并将音频片传给引擎*/
|
|
/*引擎启动成功,可以启动录音机开始录音,并将音频片传给引擎*/
|
|
- let options = {
|
|
|
|
- duration: 600000,
|
|
|
|
- sampleRate: 44100, //采样率
|
|
|
|
- numberOfChannels: 1, //录音通道数
|
|
|
|
- encodeBitRate: 192000, //编码码率
|
|
|
|
- format: 'mp3', //音频格式,有效值aac/mp3
|
|
|
|
- frameSize: 50 //指定帧大小,单位 KB
|
|
|
|
- };
|
|
|
|
//开始录音,在开始录音回调中feed音频片
|
|
//开始录音,在开始录音回调中feed音频片
|
|
- recorderManager.start(options);
|
|
|
|
|
|
+ recorderManager.start(this.options);
|
|
},
|
|
},
|
|
fail: (res) => {
|
|
fail: (res) => {
|
|
console.log("fail============= ", res);
|
|
console.log("fail============= ", res);
|
|
@@ -371,16 +371,8 @@ Page({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
songRecording() {
|
|
songRecording() {
|
|
- let options = {
|
|
|
|
- duration: 600000,
|
|
|
|
- sampleRate: 44100, //采样率
|
|
|
|
- numberOfChannels: 1, //录音通道数
|
|
|
|
- encodeBitRate: 192000, //编码码率
|
|
|
|
- format: 'mp3', //音频格式,有效值aac/mp3
|
|
|
|
- frameSize: 50 //指定帧大小,单位 KB
|
|
|
|
- };
|
|
|
|
//开始录音,在开始录音回调中feed音频片
|
|
//开始录音,在开始录音回调中feed音频片
|
|
- recorderManager.start(options);
|
|
|
|
|
|
+ recorderManager.start(this.options);
|
|
recorderManager.onError(res => {
|
|
recorderManager.onError(res => {
|
|
console.log(res, 'songError');
|
|
console.log(res, 'songError');
|
|
})
|
|
})
|