Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

怎么播放远程的mp3?

$
0
0

@289359108 写道:

    var array = new Array(0);
    array.push( 'http://192.168.1.2/wav/6d33f5661781effc3a41b456d05d61d2.mp3');
    cc.loader.load(array,cc.AudioClip, function (errors, results) {
        console.log("load finished:",results);
        if (errors) {
            for (var i = 0; i < errors.length; i++) {
                cc.log('Error url [' + errors[i] + ']: ' + results.getError(errors[i]));
            }
        }
        var tex = results.getContent('http://192.168.1.2/wav/6d33f5661781effc3a41b456d05d61d2.mp3');
        console.log("load finished:",tex);
        console.log("type:",typeof (tex))
        cc.audioEngine.playMusic( tex );
    })

用cc.loader读取不到mp3啊!请教怎么读取

帖子: 2

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>