需要做一个录音程序上传音频文件,限制做大录音时长为10分钟.
wxml文件:
// pages/readindex/readindex.js
var app = getApp();
var timer;
const recorderManager = wx.getRecorderManager();
const innerAudioContext = wx.createInnerAudioContext();
Page({
/**
* 页面的初始数据
*/
data: {
times:'00:00',
winHeight: 0,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log('readindex监听页面加载')
//获取系统信息
var that = this;
wx.getSystemInfo({
success: function(res) {
that.setData({
winHeight: res.windowHeight,
})
},
})
},
/**
*