Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sound play repeat many many time in ccb file use cocosbuilder #18523

Open
dujiadui opened this issue Nov 28, 2017 · 2 comments
Open

sound play repeat many many time in ccb file use cocosbuilder #18523

dujiadui opened this issue Nov 28, 2017 · 2 comments

Comments

@dujiadui
Copy link

dujiadui commented Nov 28, 2017

  • cocos2d-x version:3.16 c++
  • devices test on:
  • developing environments
    • NDK version:
    • Xcode version:
    • VS version:
    • browser type and version:

Steps to Reproduce:

If you use the sound in ccbfile by cocosbuilder.
it will play the sound effect repeat, this function will be called repeat forever.


void CCBSoundEffect::update(float time)
{
CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(_soundFile.c_str());
}

@dujiadui
Copy link
Author

@minggo @zilongshanren

@dujiadui
Copy link
Author

fixed it
add ActionInstant::update(time) to these two function.
void CCBSetSpriteFrame::update(float time)
{
ActionInstant::update(time);
static_cast<Sprite*>(_target)->setSpriteFrame(_spriteFrame);
}

void CCBSoundEffect::update(float time)
{
ActionInstant::update(time);
CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(_soundFile.c_str());

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant