The problem is, it doesnt show me where the problem is, so i dont know whats wrong. Before this code can work, a file called shot.wav must be saved in the sounds folder within your project. If you're only using the blue circle to play sound, then the coding for. The button is for decoration and is an object that produces sound (because the button class creates the sound). Teaches: Use of GreenfootSound API to create and optimize music and sound effects. : Index 2305 out of bounds for length 2304 If the sound only activates from pressing the arrow keys, then what is the point of the blue circle in the middle of the frame (unless it's just decoration). The sound cannot be played several times simultaneously, but can be played several times sequentially. We can make that sound play every time the crab eats a worm by adding a single line to our crab class that calls aySound after we remove a worm from the world: Give that a try. A GreenfootSound loads the audio from a file. Greenfoot is also available free of charge. After downloading and unzipping the file into a new folder (call it 'book scenarios'), copy the sound file from 'book scenario/chapter02-04/Little-Crab/sounds/slurp.wav' to the 'sounds' folder of your project 'Greenfoot/scenarios/ projectName /sounds'. Exception in thread "SoundStream:file:/D:/informatik/TieVSXfighter/Space%20Shooter%20-%20Besprechen/sounds/startmusic.mp3" Exception in thread "SoundStream:file:/D:/informatik/TieVSXfighter/Space%20Shooter%20-%20Besprechen/sounds/startmusic.mp3" : Index 2305 out of bounds for length 2304Īt javazoom.jl.(SampleBuffer.java:96)Īt javazoom.jl._pcm_samples(SynthesisFilter.java:1510)Īt javazoom.jl._pcm_samples(SynthesisFilter.java:1550)Īt javazoom.jl.(LayerIIIDecoder.java:324)Īt javazoom.jl.(LayerIIIDecoder.java:219)Īt javazoom.jl.(Decoder.java:147)Īt (Mp3AudioInputStream.java:230)Īt (SoundStream.java:255)Īt java.base/(Thread.java:834) The scenario comes with a sound ready for you to use, named 'eating.wav'. The 'chapter02-04/Little-Crab' scenarios have the 'slurp.wav' sound in them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |