Alliteration can be used in ways similar to onomatopoeia because it can be related to the sense of sound. Representing sound with words alone, as onomatopoeia does, can be difficult so, the use of alliteration can replace onomatopoeia if the author or speaker desires.