: No line matching interface SourceDataLine supporting format PCM_FLOAT 44100.0 Hz, 32 bit, stereo, 8 bytes/frame, is supported.Īt .getLine(AudioSystem.java:479)Īt (SoundStream.java:436)Īt .(SoundStream.java:102)Īt (SoundFactory.java:112)Īt .(SoundFactory.java:65)Īt (SoundFactory.java:78)Īt (GreenfootFrame.java:495)Īt .(GreenfootFrame.java:272)Īt (GreenfootFrame.java:251)Īt $2.run(GreenfootMain.java:214)Īt .dispatch(InvocationEvent.java:311)Īt (EventQueue.java:756)Īt $500(EventQueue.java:97)Īt $3.run(EventQueue.java:709)Īt $3.run(EventQueue.java:703)Īt (Native Method)Īt $JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)Īt (EventQueue.java:726)Īt (EventDispatchThread.java:201)Īt (EventDispatchThread.java:116)Īt (EventDispatchThread.java:105)Īt (EventDispatchThread.java:101)Īt (EventDispatchThread.java:93)Īt (EventDispatchThread. Do a search for the following string within the class: 'GreenfootSound music' If you find it more than once, then you problem is probably that you have an instance field AND a local field with the same name for the same type object however, the one that is playing is not the one you are checking. If you have a sound card installed, check your system settings. the issue is that as it is constantly checking if my mouse is there, it is constantly playing the sound while the mouse is there as opposed to only playing it once. as you mouse of the options, a sound is played. I want my music to stop and start at the touch of a key, not continue playing only if the 'M' key is still down. 7 So i am programming a screen in which there are three options to select. But I get this error as soon as I open Greenfoot with my wav files in the sounds file.Ĭould not play sound file: file:/C:/Users/ASUS/Desktop/Tic%20Tac%20Toe%203.0/sounds/Exit%20Friendzone%20ft.%20Eden%20-%20Iris%20%5bNCS%20Release%5d.wav Thanks, but the 'isKeyDown' method only checks to see if the key is currently down. I want to have a Menu Music and different sounds for each game mode. I have 3 game modes for the solo player mode, easy medium and hard. Public boolean onWall() // test to see if the man class is on the wall classĪctor Wall = getOneObjectAtOffset( 0, 0, Wall.class) Īctor Door = getOneObjectAtOffset( 0, 0, Door.Hey, I am currently working on a Tic Tac Toe Version which includes a duo player mode to play against your friend that sits right next to you or to play against the computer. SetLocation(getX(),getY()+1) // move downĪctor Fire = getOneObjectAtOffset( 0, 0, Fire.class) SetLocation(getX()+1,getY()) // move Right SetLocation(getX()-1,getY()) // get loaction of x and y, then move -1 on x move Left There is also a play () method (which I think you already knew) which will play the sound. There is a method called isPlaying (), which will return true if the GreenfootSound is playing, and false otherwise. You should see a green wave, and when you press play you should hear your noise played back to you. GreenfootSound is where you'll find the methods to play sound. Is there a way to make this sound plays only once if I keep the key is pressed Track the state of the key. * the 'Act' or 'Run' button gets pressed in the environment.ĬheckKeyPress() // call this method to work Press the record button and speak (or scrunch an empty food packet, or whatever), then press stop. Import greenfoot.* // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Is there a way to add a sound based on an object class that you land on? and that it will only play every 5 seconds ? so far I got it to play when I'm on the object but it plays so fast.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |