人生若只如初见

vue 播放 .amr 语音文件

电脑版发表于:2021/7/1 15:24

安装 npm install benz-amr-recorder
引入

import BenzAMRRecorder from "benz-amr-recorder";
//实例化
var amr = new BenzAMRRecorder();
             amr.initWithUrl(process.env.MessageManageUrl + result.playpath)
                .then(function () {
                  // amr.isPlaying() 返回音频的播放状态 是否正在播放 返回boolean类型
                  console.log(amr.isPlaying());
                  if (amr.isPlaying()) {
                    amr.stop();
                  } else {
                    amr.play();
                  }
                });


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢