Music and speech both have melody. The melody of speech is called prosody.
Infants learn to recognise the speech sounds of their environment and at birth they are considered to have the ability to learn any sounds.
Later on they discriminate between speech and non speech sounds.
They concentrate on reproducing the speech sounds they hear and use these familiar sounds as they first make attempts to speak (jargon).