I have an audio file. I want to segment into 10 seconds each using java. Is there a simple way to do this
In short: no, there isn't. It very much depends on the file format. Is it .wav, .mp3 or yet something else? You'll need to understand the format, read data and write your 10s segments into separate files according to file format, possibly with decoding/encoding in-between. Look for some audio libraries - they'll ease your pain.