Waves travel by transferring energy from particle to particle through a medium such as air or water. In some cases, this energy transfer creates a motion perpendicular to the direction of travel, creating transverse waves. Other waves travel by compressing the medium and creating motion parallel to the direction of movement, such as the longitudinal waves that transmit sound through the air.
The waves that travel through the ocean may seem to be transverse waves, rising and falling as they travel toward the shore. In reality, however, the energy that spawns these waves travels as longitudinal waves beneath the ocean. This horizontal movement sets up a circular motion in the water molecules at the surface, creating the distinct rolling motion of surface waves. These waves only occur at the surface of the ocean and decrease in intensity with depth.
Sound waves occur when a vibration creates longitudinal waves in the air. This compresses the air in waves, creating pockets of high and low air pressure that travel from the source of the sound. When they arrive at a listener's ear, the variations in air pressure transmit the vibration to the eardrum, and the brain is able to interpret those vibrations and convert them into audible sound.