Jump to content

What comes to your mind first?


Kiyuge

Recommended Posts

public void init(){
try {
clip = AudioSystem.getClip();
} catch (LineUnavailableException e) {
e.printStackTrace();
}

if(clip != null){

try {
clip.open();
laser =con.loadAudio("laser");// AudioSystem.getAudioInputStream(con.getClass().getResourceAsStream("/resources/sounds/laser_1.wav"));
} catch (UnsupportedAudioFileException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (LineUnavailableException e) {
e.printStackTrace();
}
}else{
System.out.println("CLIP IS NULL (init)");
}

public void playLaserSound() {
if (laser != null) {
try {
clip.open(laser);
clip.start();
} catch (LineUnavailableException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}else{
System.out.println("LASER IS NULL");
}
}

The hell you need to do for Java to play a simple sound fragment of 3 seconds...

Link to comment
Share on other sites

//(place this on main)

static void Main(string[] args)

{

int sandwiches, epicness;

Console.Write("How many sandwiches do you want today?: ");

sandwiches = int.Parse(Console.ReadLine());

if (sandwiches <= 2)

{

Console.WriteLine("Enjoy your sandviches!!");

}

else

{

Console.WriteLine("More than 2? hope you work out after such a "generous" serving... ");

}

Console.Clear();

Console.Write("BTW, in a scale of 1 to 10, how epic do you think I am?");

epicness = int.Parse(Console.ReadLine());

if (epicness <= 6)

{

epicness = epicness + 5

Console.Write("I took the liberty of modding that for you since I really am 5+, check the variable LOL");

}

else

{

Console.Write("Close enough I guess....");

}

Console.WriteLine("Press ENTER to terminate the program");

Console.ReadKey();

}

Edited by R.A.V.S.O
Link to comment
Share on other sites

Most definitely a self portrait of Chuk

Sorry to disappoint you Zephyboy, but even with your best photo-shopping skills I wouldn't even look close to that ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...