Yes, the sound waves are called blasts and is used to communicate to other ship/subs in the waters as long as they are in sight of each other and are meeting or crossing at a distance within half a mile of each other. These signals must never be used in fog or other conditions of reduced visibility, where the vessels are not visible to each other by eye.