Note that the API defines interfaces for speech synthesis (i.e. text-to-speech) and speech recognition (speech-to-text). It does not come with an implementation of either. Open source solutions for speech synthesis are available, but not to my knowledge for speech recognition.
what is the difference between Java Speech API and Java sound API?
Sound is about recording, altering and playback of soundwaves, while Speech deals with conversion of text to soundwaves and vice versa. It is probably built on top of the Sound API.