simulator audio bug

This commit is contained in:
ViusualSJ
2016-05-13 14:44:53 +08:00
parent 5d9ce5d57e
commit c8eec29aed
+10 -18
View File
@@ -5,11 +5,11 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated engine source code (the "Software"), a limited,
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
to use Cocos Creator solely to develop games on your target platforms. You shall
not use Cocos Creator software for developing other software or tools that's
used for developing games. You are not granted to publish, distribute,
sublicense, and/or sell copies of Cocos Creator.
not use Cocos Creator software for developing other software or tools that's
used for developing games. You are not granted to publish, distribute,
sublicense, and/or sell copies of Cocos Creator.
The software or tools in this License Agreement are licensed, not sold.
Chukong Aipu reserves all rights not expressly granted to you.
@@ -106,8 +106,7 @@ var AudioSource = cc.Class({
if (this.audio) {
if (cc.sys.isNative) {
cc.audioEngine.setEffectsVolume(value);
}
else {
} else {
this.audio.setVolume(value);
}
}
@@ -132,16 +131,13 @@ var AudioSource = cc.Class({
if (this._mute) {
if (cc.sys.isNative) {
cc.audioEngine.setEffectsVolume(0);
}
else {
} else {
this.audio.setVolume(0);
}
}
else {
} else {
if (cc.sys.isNative) {
cc.audioEngine.setEffectsVolume(this._volume);
}
else {
} else {
this.audio.setVolume(this._volume);
}
}
@@ -206,15 +202,11 @@ var AudioSource = cc.Class({
play: function () {
if ( this._clip ) {
var volume = this._mute ? 0 : this._volume;
this.audio = audioEngine.playEffect(this._clip, this._loop, volume);
if (cc.sys.isNative) {
audioEngine.playEffect(this._clip, this._loop);
cc.audioEngine.setEffectsVolume(volume);
}
else {
this.audio = audioEngine.playEffect(this._clip, this._loop);
if (this.audio)
this.audio.setVolume(volume);
}
}
},