Beep function in java to create the sound