Hi there. I have an array of identical samples for two bouncing orbs which are also in an array. A sample is to play each time a ball falls below a virtual water level. They trigger just fine, but there seems to be constant or random glitches in sample sounds at various other times when it has not crossed this threshold. The line in question where I set this threshold is contained within the orb_class. Perhaps this is completely wrong, but it triggers the samples at least:
void playSample(int arrayIndex){
if (orby < waterSurfaceHeight){
popsound[arrayIndex].rewind();
popsound[arrayIndex].play();
}
}
*Edit. The code is shortened to relevant code only an is quoted in a reply below this one.