前言
因项目开发需求,在创建名片的时候可选择上传语音,播放语音。所以写这博客是我之前也没有写过录音的部分。记录笔记
关于文档
录音全局变量
const recorderManager = wx.getRecorderManager()//创建录音 返回值 recorderManager
const innerAudioContext = wx.createInnerAudioContext()//播放录音 返回值 innerAudioContext
小程序创建录音
那么接下来上菜
index.html
<view class='infomationdesc'>
<text>上传录音</text>
<view class='audio-view'>
<image class='headurl' src='{
{headurl?headurl:"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1548148347&di=a062deda420f73c7d81e009fd4278f6d&src=http://b-ssl.duitang.com/uploads/item/201701/20/20170120012252