playBackgroundMusic 問題

目前使用的版本:cocos2dx-3.3rc0

在使用 playBackgroundMusic 播放背景音樂的時候

  • ios 8.1 ipod Touch 5 (32位元) -可播放
  • ios7.1 ipad mini(64位元)-不可播放

查看原因發現64位元中被 willPlayBackgroundMusic = flase,導致未執行 ;
而設定willPlayBackgroundMusic 是在 isOtherAudioPlaying 中做的(32 跟 64所return 值 不同)
目前所能解決的就是每次 playBackgroundMusic 完後 再給各 rewindBackgroundMusic()

不知道各位有沒有遇到這問題?

-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop
{
;

if (loop) {
;
} else {
;
}

if (!willPlayBackgroundMusic || _mute) {
CDLOGINFO(@“Denshion::CDAudioManager - play bgm aborted because audio is not exclusive or sound is muted”);
return;
}

;
}

-(BOOL) isOtherAudioPlaying {
UInt32 isPlaying = 0;
UInt32 varSize = sizeof(isPlaying);
AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying, &varSize, &isPlaying);
return (isPlaying != 0);
}

没接到类似的反馈。请问testcpp可以正常播放么?

試的結果
cocosDenshionTest 的 play
因為建構的時候已經有
reloadBackgroundMusic
所以當 playBackgroundMusic時
事實上會去做 pause 跟 rewind
所以還是一樣意思~(playBackgroundMusic 裡面的 play 沒執行到)
(拿掉 reloadBackgroundMusic 就沒聲音了)