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

Cannot have multiple instances of ofxCocosDenshion running at the same time #6

Open
Oscar-Rodrigues opened this issue Jul 7, 2016 · 0 comments

Comments

@Oscar-Rodrigues
Copy link

Oscar-Rodrigues commented Jul 7, 2016

I have the following code:

 void ofApp::setup(){   

    player1.setup();
    player2.setup();

    player1.addSoundEffect("switch_on.wav", 1);
    player1.loadAllAudio();

    player2.addSoundEffect("switch_off.wav", 1);
    player2.loadAllAudio();

} 

and

 void ofApp::touchDown(ofTouchEventArgs &touch){

    if(touch.x < ofGetWidth()/2) {
        player1.playSound(0);
    } else {
        player2.playSound(0);
    }
} 

on this case, player2 is correctly setup, but no sound is played.

If i comment these lines:

player1.addSoundEffect("switch_on.wav", 1);
player1.loadAllAudio();

then player2 plays perfectly.

If I load sounds and audio into player2 first, then player1 doesn't play at all and player2 plays fine.

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