在我编译代码后,如果收到一条msg,通知soundpool已弃用。我发现soundpool已经换成了soundpool.build()。
我从以下位置编辑了代码:
this.mSoundPool = new SoundPool(Cocos2dxSound.MAX_SIMULTANEOUS_STREAMS_I9100,
AudioManager.STREAM_MUSIC, Cocos2dxSound.SOUND_QUALITY);至:
this.mSoundPool = new SoundPool.Builder().Cocos2dxSound.MAX_SIMULTANEOUS_STREAMS_I9100
.AudioManager.STREAM_MUSIC .Cocos2dxSound.SOUND_QUALITY);现在我收到了错误。
有人能告诉我如何编辑代码来纠正这个问题吗?
发布于 2018-06-20 15:19:35
您的括号在这里不平衡:
this.mSoundPool = new SoundPool.Builder().Cocos2dxSound.MAX_SIMULTANEOUS_STREAMS_I9100
.AudioManager.STREAM_MUSIC .Cocos2dxSound.SOUND_QUALITY);尝试下面这样的语法:
this.mSoundPool.setAudioAttributes(new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_MEDIA)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build());https://stackoverflow.com/questions/50942188
复制相似问题