Spiders use their webs as giant hearing aids to warn them about both prey and predators, new research has found.