I have a music track I want to fade out, and I thought I could accomplish this by using this code:
As you can see, it should slowly decrease the volume in intervals of 10. Well guess what? It doesn't. When I check the volume before and after it runs this code, it's the same. What's the problem here?
for (int i =0; i<danger.length; i++) { System.out.println("Before Volume: "+(danger[i].getVolume()!=0?danger[i].getVolume():"ignore")); if (danger[0].getVolume()>2) { danger[0].pause(); danger[0].setVolume(danger[0].getVolume()-10); danger[0].play(); } else danger[0].stop(); System.out.println("After Volume: "+(danger[i].getVolume()!=0?danger[i].getVolume():"ignore")); }