The noise you are hearing is not actually the ocean – you hear it wherever you are. The shell acts as a resonator or “echo chamber” taking sound from outside and bouncing it around in mostly random ways. You can get the same effect putting your hand over your ear. Notice that it is louder if you cup your hand rather than press it flat.
Its like Drew says – the shell is amplifying the noise from outside it…you can even do it without a shell by using your cupped hand…here’s what I found when I looked it up in more detail;
“Some people have suggested that the sound you hear from the seashell is the echoing of your blood rushing through the blood vessels of your ear. That is not the case. If that were true, then the sound would intensify after exercising, since your blood races faster after exercising. However, the sound is the same even after exercising.
Others say that the whooshing sound inside the shell is generated by air flowing through the shell – air flowing through the shell and out creates a noise. You’ll notice that the sound is louder when you lift the shell slightly away from your ear than it is when the shell is right against your head. However, this theory doesn’t hold true in a soundproof room. In a soundproof room, there is still air, but when you hold the seashell to your ear, there’s no sound.
The most likely explanation for the wave-like noise is ambient noise from around you. The seashell that you are holding just slightly above your ear captures this noise, which resonates inside the shell. The size and shape of the shell therefore has some effect on the sound you hear. Different shells sound different because different shells accentuate different frequencies. You don’t even need the seashell to hear the noise. You can produce the same “ocean” sound using an empty cup or even by cupping your hand over your ear. Go ahead and try it and vary the distance at which you place the cup near your ear. The level of the sound will vary depending on the angle and distance the cup is from your ear.
Noise from outside the shell also can change the intensity of the sound you hear inside the shell. You can look at the shell as a resonating chamber. When sound from outside enters the shell, it bounces around, thus creating an audible noise. So, the louder the environment you are in, the louder the ocean-like sound will be. ” 🙂