- Creator 版本: v2.3.1
音频格式是 .amr 安卓录音文件
如果直接加载会有跨域问题
所以通过 https://blog.csdn.net/qq_31741481/article/details/105999460 这篇用 node做中转
现在能够接收到传过来的流 但是怎么写加载和播放一直有问题,试了很多种写法
cc.loader.load(‘161126549332.amr’, function (err, clip) {
console.log(err)
console.log(clip)
cc.audioEngine.play(clip, false, global.sound);
});
浏览器会报 Uncaught TypeError: clip.once is not a function
如果 在 load 中间 加入 cc.AudioClip
会报 Uncaught TypeError: this.initProps is not a function
安卓编译器会报 ERROR: Uncaught TypeError: Cannot read property ‘loaded’ of null, location: jsb-adapter/jsb-engine.js:0:0
可是明明 log 出来是有资源的