![]() ![]() Looks like it can sort-of find the file but not open it for whatever reason. : Preventing myRobot.myRobot from access: (java.io.FilePermission ringout.wav read): You may only read files in your own root package directory.Īt (RobocodeSecurityManager.java:322)Īt (Unknown Source)Īt java.io.FileInputStream.(Unknown Source)Īt .WaveFileReader.getAudioInputStream(Unknown Source)Īt .getAudioInputStream(Unknown Source)Īt (myRobot.java:196) You might also use the sample bots to provide a template containing all the necessary files to create a bot for a specific programming language and platform. You might also have a look at the provided sample bots for Robocode for inspiration. ![]() ![]() I started wondering if maybe it was my pieced-together Java 5 / 1.4 mix, so I setup XP in a virtual machine, installing only Java 1.4.2_11 and Robocode. This tutorial is about getting an introduction to creating your first bot for Robocode Tank Royale. It worked on the Mac, so I know its in the right place. This wave file is located in both C:\robocode\robots\myRobot\ and C:\robocode\robots\myRobot\myRobot.data\. The call to play the file is as such: playSound("ringout.wav") My robot resides in C:\robocode\robots\myRobot\. However, whenever I try to play the sound on my pc, I get this error:Īt .DirectAudioDevice$DirectClip.open(Unknown Source)Īt (myRobot.java:206)Īt (RobotPeer.java:633)ĪudioInputStream in = AudioSystem.getAudioInputStream(getDataFile(filename)) ĭataLine.Info info = new DataLine.Info(Clip.class, in.getFormat(), ((int)in.getFrameLength()*in.getFormat().getFrameSize())) Ĭlip clip = (Clip) AudioSystem.getLine(info) I found the below code on the internet, and it worked sucessfully on the Mac. However, it will not play on my computer, and this is where I need to develop and test it. I know that it can play sounds, I have gotten a Mac to play a 6kb random wave file that I have found. I would like for it to play a sound to add to the effect. I am using the program Robocode, to make my little death, bringing mayhem causing robot. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |