This is the organ of corti's job. The organ of corti is a structure containing thousands of tiny hair cells. It lies on the surface of the basilar membrane and extends across the length of the cochlea.
Until a wave reaches the fibers with a resonant frequency, it doesn't move the basilar membrane a whole lot. But when the wave finally does reach the resonant point, the membrane suddenly releases a burst of energy in that area. This energy is strong enough to move the organ of corti hair cells at that point.
When these hair cells are moved, they send an electrical impulse through the cochlear nerve. The cochlear nerve sends these impulses on to the cerebral cortex, where the brain interprets them. The brain determines the pitch of the sound based on the position of the cells sending electrical impulses. Louder sounds release more energy at the resonant point along the membrane and so move a greater number of hair cells in that area. The brain knows a sound is louder because more hair cells are activated in an area.
The cochlea only sends raw data -- complex patterns of electrical impulses. The brain is like a central computer, taking this input and making some sense of it all. This is an extraordinarily complex operation, and scientists are still a long way from understanding everything about it.
In fact, hearing in general is still very mysterious to us. The basic concepts at work in human and animal ears are fairly simple, but the specific structures are extremely complex. Scientists are making rapid advancements, however, and they discover new hearing elements every year. It's astonishing how much is involved in the hearing process, and it's even more amazing that all these processes take place in such a small area of the body.