The cochlea is responsible for converting mechanical vibrations into electrical signals. Within the cochlea, the basilar membrane vibrates in response to sound waves, stimulating hair cells that generate electrical signals sent to the brain for auditory processing.