Scientists at the Unviersity of Southern Denmark studied modern day lungfish and salamanders, which are capable of hearing, despite lacking an outer or tympanic middle ear. The goal of the study was to understand how hearing evolved as vertebrates moved from an aquatic to terrestrial environment. If you are like me, and forgot your high school biology, remember that the ear is made up of three overarching parts. The outer ear directs sound waves into the auditory canal. The middle ear receives these sound waves, and the tympanic membrane picks up variations in pressure. These pressure oscillations are then sent to the inner ear, which converts fluid movements into nerve signals for the brain. Having this tympanic membrane can improve the efficiency of hearing by up to 1000 times. However, this tympanic middle ear developed in the Triassic period, about 100 million years after the move of aquatic animals to a terrestrial habitat. It had always been assumed that these Early Carboniferous vertebrates were deaf. The researchers at the University of Southern Denmark played sound at varying frequencies and intensities, and proceed to measure auditory nerve signals and neural signals in the brainstem of lungfish and salamanders. The researchers showed that even these vertebrates that lack the outer and middle ear and capable of detecting airborne sounds through the vibrations induced by sound waves. They showed that this adaptation to aerial hearing came after the transition from aquatic to terrestrial lifestyles. Scientists now believe the adaptation to hearing came as a gradual process over the first 100 million years on land.
Here's the paper if you want to take a look!