This site requires JavaScript, please enable it in your browser!
Greenfoot back
loldertroll
loldertroll wrote ...

2019/6/15

Problems with playsound

loldertroll loldertroll

2019/6/15

#
So I want to play a special sound but everytime it plays in my scenario, a error pops up(Exception in thread "SoundStream:file:/C:/Users/Admin/Desktop/DavidJonas/sounds/musik.mp3" java.lang.ArrayIndexOutOfBoundsException: 580) Does somebody know how to fix this?
 if(getY() ==500)
    {
      this.timer = this.timer +2;
      if(this.timer>200)
      {
         setImage("schlappenunsichtbar.png");
         setLocation(200,230);
         Greenfoot.playSound("musik.mp3");
         this.timer=0;
         
        
            
        
        }
    }
    if(getY() ==230 && getX() == 200)
    {
     this.timer2 = this.timer2 +2;
     if(this.timer2 >800)
     {
        setImage("Badeschlappengegner1.png");
        Greenfoot.playSound("ping.mp3");
        this.timer2=0;
        setLocation(201,230);
        }
    }
coder123 coder123

2019/6/15

#
convert "musik.mp3" into a .wav. that should help
loldertroll loldertroll

2019/6/15

#
ty that helped
You need to login to post a reply.