网友回复
<template>
<view class="audioPlay">
<button @click="startRecord">开始录音</button>
<button @tap="endRecord">停止录音</button>
<button @tap="playVoice">播放录音</button>
</view>
</template>
<script>
const recorderManager = uni.getRecorderManager();
const innerAudioContext = uni.createInnerAudioContext();
export default {
data() {
return {
recorderManager: {},
innerAudioContext: {},
text: 'uni-app',
voicePath: ''
}
},
onLoad() {
innerAudioContext.autoplay = true;
console.log("uni.getRecorderManager()",uni.getRecorderManager())
console.log("uni.createInnerAudioContext()",uni.createInnerAudioContext())
let self = this;
recorderManager.onStop(function (res) {
console.log('recorder stop' + JSON.stringify(res));
self.voicePath = res.tempFilePath;
});
},
methods: {
startRecord() {
...点击查看剩余70%
systemd-nspawn与unshare区别?
Firejail、Bubblewrap沙箱与docker、podman容器区别?
如何访问unshare -n -- python3 -m http.server 8000创建的网站url?
linux中如何限制进程执行非法的系统调用命令,例如reboot 删除等等?
pivot_root与chroot有啥区别?
linux中如何限制进程使用cpu、内存、网络的最大值?
用户态沙箱、硬件隔离、namespace + cgroups的隔离有啥不同?
OverlayFS、AUFS 、 Btrfs的区别是啥?
linux上各种Namespace有啥作用?
linux体积最小最精简的版本是多大?


