Problems with sound....

I am creating an interactive visual and audio APP which should play 3 sounds. 1 sound playing in the background, one sound playing when onKeyDown and the last sound playing when onMouseDown.

My problem is that all three sounds are played once when the window opens - but only the first sound should start playing then.

Can somebody help me make a code which can do this? Please be aware that I am fairly new to programming. Thanks!

This is my code for the sound:

void onSound(AudioIOData& io){


float s1 = play1();
float s2 = play2();
float s3 = play3();

io.out(0) = s1;
io.out(1) = s2+s3;
io.out(2) = s2+s3;

Topic archived. No new replies allowed.